Skip to content

Commit

Permalink
Merge pull request #44591 from frappe/mergify/bp/version-15/pr-44579
Browse files Browse the repository at this point in the history
fix: BOM name issue (backport #44575) (backport #44579)
  • Loading branch information
rohitwaghchaure authored Dec 7, 2024
2 parents b00cc83 + 27b63be commit d860a5b
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 d860a5b

Please sign in to comment.