fix: parent item should not appear in raw material request dialog (#20216)

This commit is contained in:
Pranav Nachnekar 2020-01-09 08:02:15 +00:00 committed by Nabin Hait
parent ccdf19314d
commit 1612432f45

View File

@ -376,6 +376,9 @@ class SalesOrder(SellingController):
def get_work_order_items(self, for_raw_material_request=0):
'''Returns items with BOM that already do not have a linked work order'''
items = []
item_codes = [i.item_code for i in self.items]
product_bundle_parents = [pb.new_item_code for pb in frappe.get_all("Product Bundle", {"new_item_code": ["in", item_codes]}, ["new_item_code"])]
for table in [self.items, self.packed_items]:
for i in table:
bom = get_default_bom_item(i.item_code)
@ -387,7 +390,7 @@ class SalesOrder(SellingController):
else:
pending_qty = stock_qty
if pending_qty:
if pending_qty and i.item_code not in product_bundle_parents:
if bom:
items.append(dict(
name= i.name,