Skip to content

Commit

Permalink
fix: recursion issue while submitting work order (backport #40400) (#…
Browse files Browse the repository at this point in the history
…40401)

* fix: recursion issue while submitting work order (#40400)

(cherry picked from commit 72614bb)

# Conflicts:
#	erpnext/manufacturing/doctype/job_card/job_card.py

* chore: fix conflicts

---------

Co-authored-by: rohitwaghchaure <rohitw1991@gmail.com>
  • Loading branch information
mergify[bot] and rohitwaghchaure authored Mar 12, 2024
1 parent 80df609 commit 06e3874
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions erpnext/manufacturing/doctype/job_card/job_card.py
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ def get_overlap_for(self, args):
if not self.has_overlap(production_capacity, existing_time_logs):
return {}

if self.workstation_type:
if not self.workstation and self.workstation_type:
if workstation := self.get_workstation_based_on_available_slot(existing_time_logs):
self.workstation = workstation
return None
Expand Down Expand Up @@ -305,7 +305,7 @@ def check_workstation_time(self, row):
if not workstation_doc.working_hours or cint(
frappe.db.get_single_value("Manufacturing Settings", "allow_overtime")
):
if get_datetime(row.planned_end_time) < get_datetime(row.planned_start_time):
if get_datetime(row.planned_end_time) <= get_datetime(row.planned_start_time):
row.planned_end_time = add_to_date(row.planned_start_time, minutes=row.time_in_mins)
row.remaining_time_in_mins = 0.0
else:
Expand Down

0 comments on commit 06e3874

Please sign in to comment.