fix(ux): "New Version" button BOM

"duplicate" technically creates a new version but that's not intuitive
at all.
This commit is contained in:
Ankush Menat 2022-05-29 14:32:32 +05:30
parent 85b48fcdb9
commit b170cec2fe

View File

@ -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");