From a60c64857a05e9d24656628e3004526d2fa47653 Mon Sep 17 00:00:00 2001 From: "mergify[bot]" <37929162+mergify[bot]@users.noreply.github.com> Date: Thu, 18 Nov 2021 14:11:45 +0530 Subject: [PATCH] fix: unchecking the "With Operations" in BOM clears operations table (backport #28446) (#28447) * fix: unchecking the "With Operations" in BOM clears operations table #28446 (cherry picked from commit 488d34af1f88724dd5a6bd298c949ac3c39e5e1b) # Conflicts: # erpnext/manufacturing/doctype/bom/bom.js * fix: resolve conflict Co-authored-by: Sagar Sharma <63660334+s-aga-r@users.noreply.github.com> Co-authored-by: Ankush Menat --- erpnext/manufacturing/doctype/bom/bom.js | 5 ----- erpnext/manufacturing/doctype/bom/bom.json | 3 ++- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/erpnext/manufacturing/doctype/bom/bom.js b/erpnext/manufacturing/doctype/bom/bom.js index 23004ee41d7..34d6d012418 100644 --- a/erpnext/manufacturing/doctype/bom/bom.js +++ b/erpnext/manufacturing/doctype/bom/bom.js @@ -680,11 +680,6 @@ frappe.ui.form.on("BOM Item", "items_remove", function(frm) { erpnext.bom.calculate_total(frm.doc); }); -frappe.ui.form.on("BOM", "with_operations", function(frm) { - if(!cint(frm.doc.with_operations)) { - frm.set_value("operations", []); - } -}); frappe.ui.form.on("BOM Scrap Item", { item_code(frm, cdt, cdn) { diff --git a/erpnext/manufacturing/doctype/bom/bom.json b/erpnext/manufacturing/doctype/bom/bom.json index 62187077f3d..218ac64d8da 100644 --- a/erpnext/manufacturing/doctype/bom/bom.json +++ b/erpnext/manufacturing/doctype/bom/bom.json @@ -237,6 +237,7 @@ "options": "Price List" }, { + "depends_on": "with_operations", "fieldname": "operations_section", "fieldtype": "Section Break", "hide_border": 1, @@ -539,7 +540,7 @@ "image_field": "image", "is_submittable": 1, "links": [], - "modified": "2021-10-27 14:52:04.500251", + "modified": "2021-11-18 13:04:16.271975", "modified_by": "Administrator", "module": "Manufacturing", "name": "BOM",