Skip to content

Commit

Permalink
Merge pull request #45382 from rohitwaghchaure/fixed-support-29769
Browse files Browse the repository at this point in the history
fix: precision issue causing incorrect status
  • Loading branch information
rohitwaghchaure authored Jan 22, 2025
2 parents b26f0b6 + 4a7586c commit c5f21a5
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 c5f21a5

Please sign in to comment.