From d640c79c1c4fafd00fe47bbd85b937ebe575c840 Mon Sep 17 00:00:00 2001 From: Mihir Kandoi Date: Tue, 29 Apr 2025 16:21:41 +0530 Subject: [PATCH] fix: validate if from and to time are present on submission of job card (#47325) (cherry picked from commit 7499c25a3c7045e14ca0c4bd3985e7f408e3eead) --- erpnext/manufacturing/doctype/job_card/job_card.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/erpnext/manufacturing/doctype/job_card/job_card.py b/erpnext/manufacturing/doctype/job_card/job_card.py index 659bb01b4d4..abea4bca606 100644 --- a/erpnext/manufacturing/doctype/job_card/job_card.py +++ b/erpnext/manufacturing/doctype/job_card/job_card.py @@ -705,6 +705,12 @@ class JobCard(Document): bold("Job Card"), get_link_to_form("Job Card", self.name) ) ) + else: + for row in self.time_logs: + if not row.from_time or not row.to_time: + frappe.throw( + _("Row #{0}: From Time and To Time fields are required").format(row.idx), + ) precision = self.precision("total_completed_qty") total_completed_qty = flt(