Skip to content

Commit

Permalink
fix: precision issue causing incorrect status
Browse files Browse the repository at this point in the history
  • Loading branch information
rohitwaghchaure committed Jan 22, 2025
1 parent b26f0b6 commit 4a7586c
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions erpnext/manufacturing/doctype/work_order/work_order.py
Original file line number Diff line number Diff line change
Expand Up @@ -366,8 +366,9 @@ def get_status(self, status=None):
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"
Expand Down

0 comments on commit 4a7586c

Please sign in to comment.