fix: check item_code in all rows of po_items (backport #31741) (#31843)

fix: check item_code in all rows of po_items (#31741)

fix: check item-code in each row of po-items
(cherry picked from commit 0047e18a9b)

Co-authored-by: Sagar Sharma <sagarsharma.s312@gmail.com>
This commit is contained in:
mergify[bot]
2022-08-17 11:21:47 +05:30
committed by GitHub
parent 14891ccf18
commit ba8dc8925f

View File

@@ -639,6 +639,9 @@ class ProductionPlan(Document):
def get_sub_assembly_items(self, manufacturing_type=None):
self.sub_assembly_items = []
for row in self.po_items:
if not row.item_code:
frappe.throw(_("Row #{0}: Please select Item Code in Assembly Items").format(row.idx))
bom_data = []
get_sub_assembly_items(row.bom_no, bom_data, row.planned_qty)
self.set_sub_assembly_items_based_on_level(row, bom_data, manufacturing_type)