diff --git a/erpnext/manufacturing/doctype/work_order/work_order.py b/erpnext/manufacturing/doctype/work_order/work_order.py index 5e4dcf22431..fe2115c7022 100644 --- a/erpnext/manufacturing/doctype/work_order/work_order.py +++ b/erpnext/manufacturing/doctype/work_order/work_order.py @@ -979,14 +979,14 @@ class WorkOrder(Document): for d in self.get("operations"): precision = d.precision("completed_qty") - qty = flt(d.completed_qty, precision) + flt(d.process_loss_qty, precision) + qty = flt(flt(d.completed_qty, precision) + flt(d.process_loss_qty, precision), precision) if not qty: d.status = "Pending" - elif flt(qty) < flt(self.qty): + elif qty < flt(self.qty, precision): d.status = "Work in Progress" - elif flt(qty) == flt(self.qty): + elif qty == flt(self.qty, precision): d.status = "Completed" - elif flt(qty) <= max_allowed_qty_for_wo: + elif qty <= flt(max_allowed_qty_for_wo, precision): d.status = "Completed" else: frappe.throw(_("Completed Qty cannot be greater than 'Qty to Manufacture'"))