fix: max_qty validation condition

This commit is contained in:
Sagar Sharma
2022-03-14 12:05:34 +05:30
parent fc257fa58d
commit d198c488a4

View File

@@ -640,7 +640,7 @@ class WorkOrder(Document):
max_qty = qty_dict.get("planned_qty", 0) + allowance_qty - qty_dict.get("ordered_qty", 0) max_qty = qty_dict.get("planned_qty", 0) + allowance_qty - qty_dict.get("ordered_qty", 0)
if max_qty < 1: if not max_qty > 0:
frappe.throw(_("Cannot produce more item for {0}") frappe.throw(_("Cannot produce more item for {0}")
.format(self.production_item), OverProductionError) .format(self.production_item), OverProductionError)
elif self.qty > max_qty: elif self.qty > max_qty: