From 44ec05f79bfa3a2d76d160ac4805d36450ea8b8e Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Mon, 15 Oct 2018 18:56:16 +0530 Subject: [PATCH] fix(bom): deadlock issue via bom replace tool (#15694) --- erpnext/manufacturing/doctype/bom/bom.py | 3 ++- .../manufacturing/doctype/bom_update_tool/bom_update_tool.py | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/erpnext/manufacturing/doctype/bom/bom.py b/erpnext/manufacturing/doctype/bom/bom.py index 7a2aa8a06b..0af7a86b93 100644 --- a/erpnext/manufacturing/doctype/bom/bom.py +++ b/erpnext/manufacturing/doctype/bom/bom.py @@ -354,7 +354,8 @@ class BOM(WebsiteGenerator): bom_list = self.traverse_tree(bom_list) for bom in bom_list: bom_obj = frappe.get_doc("BOM", bom) - bom_obj.on_update() + bom_obj.check_recursion() + bom_obj.update_exploded_items() return bom_list diff --git a/erpnext/manufacturing/doctype/bom_update_tool/bom_update_tool.py b/erpnext/manufacturing/doctype/bom_update_tool/bom_update_tool.py index 3f6cb44c49..59861ceba3 100644 --- a/erpnext/manufacturing/doctype/bom_update_tool/bom_update_tool.py +++ b/erpnext/manufacturing/doctype/bom_update_tool/bom_update_tool.py @@ -62,7 +62,7 @@ class BOMUpdateTool(Document): bom_list.append(d[0]) self.get_parent_boms(d[0], bom_list) - return bom_list + return list(set(bom_list)) @frappe.whitelist() def enqueue_replace_bom(args):