fix(manufacturing): handle duplicate root BOM items (#58614)

* fix(manufacturing): handle duplicate root BOM items

* test(manufacturing): remove duplicate root item test

(cherry picked from commit 24209ae699)
This commit is contained in:
Mihir Kandoi
2026-08-31 19:34:26 +05:30
committed by Mergify
parent 2390d48c01
commit ca6dec1c3e

View File

@@ -91,14 +91,10 @@ class BOMCreator(Document):
key = (row.item_code, row.fg_reference_id)
if key in item_map:
parent_item_code = next(
item.item_code for item in self.items if item.name == row.fg_reference_id
)
frappe.throw(
_(
"Item {0} added multiple times under the same parent item {1} at rows {2} and {3}"
).format(bold(row.item_code), bold(parent_item_code), item_map[key], row.idx),
).format(bold(row.item_code), bold(row.fg_item), item_map[key], row.idx),
title=_("Duplicate Item Under Same Parent"),
)
else: