Merge pull request #19852 from rohitwaghchaure/fixed_timesheet_overlap_issue_v11_hotfix

fix: timesheet overlap error
This commit is contained in:
rohitwaghchaure
2019-12-07 14:10:35 +05:30
committed by GitHub

View File

@@ -191,6 +191,9 @@ class Timesheet(Document):
}, as_dict=True)
# check internal overlap
for time_log in self.time_logs:
if not (time_log.from_time and time_log.to_time
and args.from_time and args.to_time): continue
if (fieldname != 'workstation' or args.get(fieldname) == time_log.get(fieldname)) and \
args.idx != time_log.idx and ((args.from_time > time_log.from_time and args.from_time < time_log.to_time) or
(args.to_time > time_log.from_time and args.to_time < time_log.to_time) or