From 422a9161ddb34a542a9fb226e3250f7ff6f4d8cb Mon Sep 17 00:00:00 2001 From: pandiyan Date: Mon, 10 Aug 2026 16:02:39 +0530 Subject: [PATCH 1/2] fix: convert hours to minutes in workstation complete_job `time_diff_in_hours` returns hours, so `time_in_mins` needs `* 60`, not `/ 60`. Matches `Job Card.validate_time_log_row`. No behaviour change: the `doc.save()` on the next line runs Job Card's `validate`, which recomputes `time_in_mins` correctly before the row is written. This only stops the expression from reading as a bug. --- erpnext/manufacturing/doctype/workstation/workstation.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/erpnext/manufacturing/doctype/workstation/workstation.py b/erpnext/manufacturing/doctype/workstation/workstation.py index 6d3c184fdef..9fd02f5e181 100644 --- a/erpnext/manufacturing/doctype/workstation/workstation.py +++ b/erpnext/manufacturing/doctype/workstation/workstation.py @@ -242,7 +242,7 @@ class Workstation(Document): for row in doc.time_logs: if not row.to_time: row.to_time = to_time - row.time_in_mins = time_diff_in_hours(row.to_time, row.from_time) / 60 + row.time_in_mins = time_diff_in_hours(row.to_time, row.from_time) * 60 row.completed_qty = qty doc.save() From 3cffeb68e3e719eddc3c3ceb34166f8311782451 Mon Sep 17 00:00:00 2001 From: Mihir Kandoi Date: Tue, 11 Aug 2026 11:56:13 +0530 Subject: [PATCH 2/2] refactor: drop redundant time_in_mins assignment in complete_job --- erpnext/manufacturing/doctype/workstation/workstation.py | 1 - 1 file changed, 1 deletion(-) diff --git a/erpnext/manufacturing/doctype/workstation/workstation.py b/erpnext/manufacturing/doctype/workstation/workstation.py index 9fd02f5e181..e11c81e527a 100644 --- a/erpnext/manufacturing/doctype/workstation/workstation.py +++ b/erpnext/manufacturing/doctype/workstation/workstation.py @@ -242,7 +242,6 @@ class Workstation(Document): for row in doc.time_logs: if not row.to_time: row.to_time = to_time - row.time_in_mins = time_diff_in_hours(row.to_time, row.from_time) * 60 row.completed_qty = qty doc.save()