fix: BOM name issue (#44575)

fix: bom name issue
This commit is contained in:
rohitwaghchaure
2024-12-06 16:54:38 +05:30
committed by GitHub
parent 72256565bb
commit b7a3c6b6ca

View File

@@ -179,9 +179,14 @@ class BOM(WebsiteGenerator):
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: