From e19066afcf82ce40fe20d138776dd8ddd6eb3456 Mon Sep 17 00:00:00 2001 From: rohitwaghchaure Date: Fri, 6 Dec 2024 16:54:38 +0530 Subject: [PATCH] fix: BOM name issue (#44575) fix: bom name issue (cherry picked from commit b7a3c6b6ca902138007daff2343abe14f91157f7) # Conflicts: # erpnext/manufacturing/doctype/bom/bom.py --- erpnext/manufacturing/doctype/bom/bom.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/erpnext/manufacturing/doctype/bom/bom.py b/erpnext/manufacturing/doctype/bom/bom.py index 920e2def12c..43187ac5e6a 100644 --- a/erpnext/manufacturing/doctype/bom/bom.py +++ b/erpnext/manufacturing/doctype/bom/bom.py @@ -109,9 +109,18 @@ class BOM(WebsiteGenerator): def autoname(self): # ignore amended documents while calculating current index existing_boms = frappe.get_all( +<<<<<<< HEAD "BOM", filters={"item": self.item, "amended_from": ["is", "not set"]}, pluck="name" +======= + "BOM", filters={"name": search_key, "amended_from": ["is", "not set"]}, pluck="name" +>>>>>>> b7a3c6b6ca (fix: BOM name issue (#44575)) ) + if not existing_boms: + existing_boms = frappe.get_all( + "BOM", filters={"name": ("like", search_key), "amended_from": ["is", "not set"]}, pluck="name" + ) + if existing_boms: index = self.get_next_version_index(existing_boms) else: