Update workstation.py
This commit is contained in:
parent
14823d0d0f
commit
d0839799c1
@ -60,6 +60,7 @@ def is_within_operating_hours(workstation, operation, from_datetime, to_datetime
|
|||||||
workstation = frappe.get_doc("Workstation", workstation)
|
workstation = frappe.get_doc("Workstation", workstation)
|
||||||
|
|
||||||
for working_hour in workstation.working_hours:
|
for working_hour in workstation.working_hours:
|
||||||
|
if working_hour.start_time and working_hour.end_time:
|
||||||
slot_length = (to_timedelta(working_hour.end_time or "") - to_timedelta(working_hour.start_time or "")).total_seconds()
|
slot_length = (to_timedelta(working_hour.end_time or "") - to_timedelta(working_hour.start_time or "")).total_seconds()
|
||||||
if slot_length >= operation_length:
|
if slot_length >= operation_length:
|
||||||
return
|
return
|
||||||
|
Loading…
x
Reference in New Issue
Block a user