Skip to content

Commit

Permalink
fix: BOM name issue (backport #44575) (#44579)
Browse files Browse the repository at this point in the history
fix: BOM name issue (#44575)

fix: bom name issue
(cherry picked from commit b7a3c6b)

Co-authored-by: rohitwaghchaure <[email protected]>
(cherry picked from commit 03ae9e2)
  • Loading branch information
mergify[bot] committed Dec 7, 2024
1 parent 1d158d5 commit 27b63be
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion erpnext/manufacturing/doctype/bom/bom.py
Original file line number Diff line number Diff line change
Expand Up @@ -176,9 +176,14 @@ def autoname(self):

search_key = f"{self.doctype}-{self.item}%"
existing_boms = frappe.get_all(
"BOM", filters={"name": ("like", search_key), "amended_from": ["is", "not set"]}, pluck="name"
"BOM", filters={"name": search_key, "amended_from": ["is", "not set"]}, pluck="name"
)

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:
Expand Down

0 comments on commit 27b63be

Please sign in to comment.