From 06e38749bc10bff280696caa1685ac3c39e2a663 Mon Sep 17 00:00:00 2001 From: "mergify[bot]" <37929162+mergify[bot]@users.noreply.github.com> Date: Tue, 12 Mar 2024 16:53:48 +0530 Subject: [PATCH] fix: recursion issue while submitting work order (backport #40400) (#40401) * fix: recursion issue while submitting work order (#40400) (cherry picked from commit 72614bb8ffb9ff83d40f1caa301464dad633aeda) # Conflicts: # erpnext/manufacturing/doctype/job_card/job_card.py * chore: fix conflicts --------- Co-authored-by: rohitwaghchaure --- erpnext/manufacturing/doctype/job_card/job_card.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/erpnext/manufacturing/doctype/job_card/job_card.py b/erpnext/manufacturing/doctype/job_card/job_card.py index 1823efbbaaa..5253c5ffda8 100644 --- a/erpnext/manufacturing/doctype/job_card/job_card.py +++ b/erpnext/manufacturing/doctype/job_card/job_card.py @@ -215,7 +215,7 @@ class JobCard(Document): 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 @@ -305,7 +305,7 @@ class JobCard(Document): 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: