From b170cec2fe84f4fc8d0908979194a61f40df0f74 Mon Sep 17 00:00:00 2001 From: Ankush Menat Date: Sun, 29 May 2022 14:32:32 +0530 Subject: [PATCH] fix(ux): "New Version" button BOM "duplicate" technically creates a new version but that's not intuitive at all. --- erpnext/manufacturing/doctype/bom/bom.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/erpnext/manufacturing/doctype/bom/bom.js b/erpnext/manufacturing/doctype/bom/bom.js index 3d96f9c9c72..d74379881ca 100644 --- a/erpnext/manufacturing/doctype/bom/bom.js +++ b/erpnext/manufacturing/doctype/bom/bom.js @@ -93,6 +93,11 @@ frappe.ui.form.on("BOM", { }); } + frm.add_custom_button(__("New Version"), function() { + let new_bom = frappe.model.copy_doc(frm.doc); + frappe.set_route("Form", "BOM", new_bom.name); + }); + if(frm.doc.docstatus==1) { frm.add_custom_button(__("Work Order"), function() { frm.trigger("make_work_order");