Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: ignore random periodicity in validations #27813

Merged
merged 1 commit into from
Oct 5, 2021

Conversation

ankush
Copy link
Member

@ankush ankush commented Oct 5, 2021

"Random" periodicity doesn't have a mapping in days_to_period dictionary.

Error ReportTraceback (most recent call last):
 File "/home/frappe/frappe-bench/apps/frappe/frappe/desk/form/save.py", line 21, in savedocs
  doc.save()
 File "/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py", line 285, in save
  return self._save(*args, **kwargs)
 File "/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py", line 320, in _save
  self.run_before_save_methods()
 File "/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py", line 968, in run_before_save_methods
  self.run_method("validate")
 File "/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py", line 860, in run_method
  out = Document.hook(fn)(self, *args, **kwargs)
 File "/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py", line 1158, in composer
  return composed(self, method, *args, **kwargs)
 File "/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py", line 1141, in runner
  add_to_return_value(self, fn(self, *args, **kwargs))
 File "/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py", line 854, in 
  fn = lambda self, *args, **kwargs: getattr(self, method)(*args, **kwargs)
 File "/home/frappe/frappe-bench/apps/erpnext/erpnext/maintenance/doctype/maintenance_schedule/maintenance_schedule.py", line 202, in validate
  self.validate_end_date_visits()
 File "/home/frappe/frappe-bench/apps/erpnext/erpnext/maintenance/doctype/maintenance_schedule/maintenance_schedule.py", line 57, in validate_end_date_visits
  no_of_visits = cint(diff / days_in_period[item.periodicity])
KeyError: 'Random'

@noahjacob
Copy link
Contributor

@Mergifyio backport version-13-pre-release

@mergify
Copy link
Contributor

mergify bot commented Oct 5, 2021

Command backport version-13-pre-release: success

Backports have been created

noahjacob added a commit that referenced this pull request Oct 5, 2021
…-27813

fix: ignore random periodicity in validations (backport #27813)
noahjacob added a commit that referenced this pull request Oct 5, 2021
…se/pr-27813

fix: ignore random periodicity in validations (backport #27813)
asoral pushed a commit to asoral/erpnext that referenced this pull request Nov 12, 2021
fix: ignore random periodicity in validations
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants