fix(sales_order.py): handle zero bundle qty
This commit is contained in:
parent
fb491a568f
commit
29c46bb311
@ -282,6 +282,10 @@ class WorkOrder(Document):
|
|||||||
total_bundle_qty = frappe.db.sql(""" select sum(qty) from
|
total_bundle_qty = frappe.db.sql(""" select sum(qty) from
|
||||||
`tabProduct Bundle Item` where parent = %s""", (frappe.db.escape(self.product_bundle_item)))[0][0]
|
`tabProduct Bundle Item` where parent = %s""", (frappe.db.escape(self.product_bundle_item)))[0][0]
|
||||||
|
|
||||||
|
if not total_bundle_qty:
|
||||||
|
# product bundle is 0 (product bundle allows 0 qty for items)
|
||||||
|
total_bundle_qty = 1
|
||||||
|
|
||||||
cond = "product_bundle_item = %s" if self.product_bundle_item else "production_item = %s"
|
cond = "product_bundle_item = %s" if self.product_bundle_item else "production_item = %s"
|
||||||
|
|
||||||
qty = frappe.db.sql(""" select sum(qty) from
|
qty = frappe.db.sql(""" select sum(qty) from
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user