Validate dates, fixes #6542
This commit is contained in:
parent
86da020dcd
commit
9ac2fc932d
@ -145,7 +145,7 @@ class Timesheet(Document):
|
||||
|
||||
def validate_dates(self):
|
||||
for data in self.time_logs:
|
||||
if time_diff_in_hours(data.to_time, data.from_time) < 0:
|
||||
if data.from_time and data.to_time and time_diff_in_hours(data.to_time, data.from_time) < 0:
|
||||
frappe.throw(_("To date cannot be before from date"))
|
||||
|
||||
def validate_time_logs(self):
|
||||
|
Loading…
x
Reference in New Issue
Block a user