fix: parent item should not appear in raw material request dialog (#20216)
This commit is contained in:
parent
ccdf19314d
commit
1612432f45
@ -376,6 +376,9 @@ class SalesOrder(SellingController):
|
|||||||
def get_work_order_items(self, for_raw_material_request=0):
|
def get_work_order_items(self, for_raw_material_request=0):
|
||||||
'''Returns items with BOM that already do not have a linked work order'''
|
'''Returns items with BOM that already do not have a linked work order'''
|
||||||
items = []
|
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 table in [self.items, self.packed_items]:
|
||||||
for i in table:
|
for i in table:
|
||||||
bom = get_default_bom_item(i.item_code)
|
bom = get_default_bom_item(i.item_code)
|
||||||
@ -387,7 +390,7 @@ class SalesOrder(SellingController):
|
|||||||
else:
|
else:
|
||||||
pending_qty = stock_qty
|
pending_qty = stock_qty
|
||||||
|
|
||||||
if pending_qty:
|
if pending_qty and i.item_code not in product_bundle_parents:
|
||||||
if bom:
|
if bom:
|
||||||
items.append(dict(
|
items.append(dict(
|
||||||
name= i.name,
|
name= i.name,
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user