Hello, trying to save a leave allocation for 1 day, 06/03/16-06/03/16 (friday) and get the following:
“To date cannot be before from date”
Tried changing the dates with no luck. We have tons of leaves allocated with no issues…not sure what the problem is. Any help would be greatly appreciated
erpnext 6.27.22
frappe 6.27.21
Here is the console when I click save
Traceback (innermost last):
File "/home/erpnext/frappe-bench/apps/frappe/frappe/desk/form/save.py", line 18, in savedocs
doc.save()
File "/home/erpnext/frappe-bench/apps/frappe/frappe/model/document.py", line 244, in save
self.run_before_save_methods()
File "/home/erpnext/frappe-bench/apps/frappe/frappe/model/document.py", line 617, in run_before_save_methods
self.run_method("validate")
File "/home/erpnext/frappe-bench/apps/frappe/frappe/model/document.py", line 579, in run_method
return Document.hook(fn)(self, *args, **kwargs)
File "/home/erpnext/frappe-bench/apps/frappe/frappe/model/document.py", line 735, in composer
return composed(self, method, *args, **kwargs)
File "/home/erpnext/frappe-bench/apps/frappe/frappe/model/document.py", line 718, in runner
add_to_return_value(self, fn(self, *args, **kwargs))
File "/home/erpnext/frappe-bench/apps/frappe/frappe/model/document.py", line 573, in <lambda>
fn = lambda self, *args, **kwargs: getattr(self, method)(*args, **kwargs)
File "/home/erpnext/frappe-bench/apps/erpnext/erpnext/hr/doctype/leave_allocation/leave_allocation.py", line 20, in validate
self.validate_period()
File "/home/erpnext/frappe-bench/apps/erpnext/erpnext/hr/doctype/leave_allocation/leave_allocation.py", line 39, in validate_period
frappe.throw(_("To date cannot be before from date"))
File "/home/erpnext/frappe-bench/apps/frappe/frappe/__init__.py", line 264, in throw
msgprint(msg, raise_exception=exc)
File "/home/erpnext/frappe-bench/apps/frappe/frappe/__init__.py", line 257, in msgprint
_raise_exception()
File "/home/erpnext/frappe-bench/apps/frappe/frappe/__init__.py", line 242, in _raise_exception
raise raise_exception, encode(msg)
ValidationError: To date cannot be before from date
desk.min.js:7297 Traceback (innermost last):
File "/home/erpnext/frappe-bench/apps/frappe/frappe/app.py", line 57, in application
response = frappe.handler.handle()
File "/home/erpnext/frappe-bench/apps/frappe/frappe/handler.py", line 19, in handle
execute_cmd(cmd)
File "/home/erpnext/frappe-bench/apps/frappe/frappe/handler.py", line 36, in execute_cmd
ret = frappe.call(method, **frappe.form_dict)
File "/home/erpnext/frappe-bench/apps/frappe/frappe/__init__.py", line 806, in call
return fn(*args, **newargs)
File "/home/erpnext/frappe-bench/apps/frappe/frappe/desk/form/save.py", line 18, in savedocs
doc.save()
File "/home/erpnext/frappe-bench/apps/frappe/frappe/model/document.py", line 244, in save
self.run_before_save_methods()
File "/home/erpnext/frappe-bench/apps/frappe/frappe/model/document.py", line 617, in run_before_save_methods
self.run_method("validate")
File "/home/erpnext/frappe-bench/apps/frappe/frappe/model/document.py", line 579, in run_method
return Document.hook(fn)(self, *args, **kwargs)
File "/home/erpnext/frappe-bench/apps/frappe/frappe/model/document.py", line 735, in composer
return composed(self, method, *args, **kwargs)
File "/home/erpnext/frappe-bench/apps/frappe/frappe/model/document.py", line 718, in runner
add_to_return_value(self, fn(self, *args, **kwargs))
File "/home/erpnext/frappe-bench/apps/frappe/frappe/model/document.py", line 573, in <lambda>
fn = lambda self, *args, **kwargs: getattr(self, method)(*args, **kwargs)
File "/home/erpnext/frappe-bench/apps/erpnext/erpnext/hr/doctype/leave_allocation/leave_allocation.py", line 20, in validate
self.validate_period()
File "/home/erpnext/frappe-bench/apps/erpnext/erpnext/hr/doctype/leave_allocation/leave_allocation.py", line 39, in validate_period
frappe.throw(_("To date cannot be before from date"))
File "/home/erpnext/frappe-bench/apps/frappe/frappe/__init__.py", line 264, in throw
msgprint(msg, raise_exception=exc)
File "/home/erpnext/frappe-bench/apps/frappe/frappe/__init__.py", line 257, in msgprint
_raise_exception()
File "/home/erpnext/frappe-bench/apps/frappe/frappe/__init__.py", line 242, in _raise_exception
raise raise_exception, encode(msg)
ValidationError: To date cannot be before from date