fix: added validation if parent id is missing in BOM Creator

(cherry picked from commit 0a1fab762f)
This commit is contained in:
Rohit Waghchaure
2024-04-02 11:14:51 +05:30
committed by Mergify
parent 204aea856d
commit 87ce9d834f

View File

@@ -240,6 +240,9 @@ class BOMCreator(Document):
(row.item_code, row.name), frappe._dict({"items": [], "bom_no": "", "fg_item_data": row})
)
if not row.fg_reference_id and production_item_wise_rm.get((row.fg_item, row.fg_reference_id)):
frappe.throw(_("Please set Parent Row No for item {0}").format(row.fg_item))
production_item_wise_rm[(row.fg_item, row.fg_reference_id)]["items"].append(row)
reverse_tree = OrderedDict(reversed(list(production_item_wise_rm.items())))