From ca6dec1c3e2b9b94c19f40b72d600f42e569b936 Mon Sep 17 00:00:00 2001 From: Mihir Kandoi Date: Mon, 31 Aug 2026 19:34:26 +0530 Subject: [PATCH] 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 24209ae699190cbba364e763f232695ca7f64b3b) --- erpnext/manufacturing/doctype/bom_creator/bom_creator.py | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/erpnext/manufacturing/doctype/bom_creator/bom_creator.py b/erpnext/manufacturing/doctype/bom_creator/bom_creator.py index f589ec1acc4..7e977b66f41 100644 --- a/erpnext/manufacturing/doctype/bom_creator/bom_creator.py +++ b/erpnext/manufacturing/doctype/bom_creator/bom_creator.py @@ -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: