fix: incorrect bom name (#26600)

This commit is contained in:
rohitwaghchaure 2021-07-22 16:10:06 +05:30 committed by GitHub
parent 5b32fa5ccd
commit 56c67743ab
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 4 deletions

View File

@ -83,7 +83,7 @@ frappe.ui.form.on("BOM", {
if (!frm.doc.__islocal && frm.doc.docstatus<2) {
frm.add_custom_button(__("Update Cost"), function() {
frm.events.update_cost(frm);
frm.events.update_cost(frm, true);
});
frm.add_custom_button(__("Browse BOM"), function() {
frappe.route_options = {
@ -318,14 +318,15 @@ frappe.ui.form.on("BOM", {
})
},
update_cost: function(frm) {
update_cost: function(frm, save_doc=false) {
return frappe.call({
doc: frm.doc,
method: "update_cost",
freeze: true,
args: {
update_parent: true,
from_child_bom:false
save: save_doc,
from_child_bom: false
},
callback: function(r) {
refresh_field("items");

View File

@ -330,7 +330,7 @@ class BOM(WebsiteGenerator):
frappe.get_doc("BOM", bom).update_cost(from_child_bom=True)
if not from_child_bom:
frappe.msgprint(_("Cost Updated"))
frappe.msgprint(_("Cost Updated"), alert=True)
def update_parent_cost(self):
if self.total_cost: