fix: max_qty validation condition
(cherry picked from commit d198c488a4071d13d0891d87f790562febd44b3e)
This commit is contained in:
parent
fda60da07b
commit
3b86d6c73c
@ -652,7 +652,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:
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user