From 46a2b7a07e5326ad5fde89d030460a5e9f2b67b0 Mon Sep 17 00:00:00 2001 From: Rohit Waghchaure Date: Wed, 22 Jan 2025 18:02:49 +0530 Subject: [PATCH] fix: precision issue causing incorrect status (cherry picked from commit 4a7586cc01d589c35c8e79906a15e3f29a5f07fb) --- erpnext/manufacturing/doctype/work_order/work_order.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/erpnext/manufacturing/doctype/work_order/work_order.py b/erpnext/manufacturing/doctype/work_order/work_order.py index 515520b4810..332a86979c2 100644 --- a/erpnext/manufacturing/doctype/work_order/work_order.py +++ b/erpnext/manufacturing/doctype/work_order/work_order.py @@ -348,8 +348,9 @@ class WorkOrder(Document): if flt(self.material_transferred_for_manufacturing) > 0: status = "In Process" - total_qty = flt(flt(self.produced_qty) + flt(self.process_loss_qty), self.precision("qty")) - if flt(total_qty) >= flt(self.qty): + precision = frappe.get_precision("Work Order", "produced_qty") + total_qty = flt(self.produced_qty, precision) + flt(self.process_loss_qty, precision) + if flt(total_qty, precision) >= flt(self.qty, precision): status = "Completed" else: status = "Cancelled"