fix: incorrect bom name (bp #26600)
This commit is contained in:
parent
4ee6571784
commit
ce3e877c40
@ -83,7 +83,7 @@ frappe.ui.form.on("BOM", {
|
|||||||
|
|
||||||
if (!frm.doc.__islocal && frm.doc.docstatus<2) {
|
if (!frm.doc.__islocal && frm.doc.docstatus<2) {
|
||||||
frm.add_custom_button(__("Update Cost"), function() {
|
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() {
|
frm.add_custom_button(__("Browse BOM"), function() {
|
||||||
frappe.route_options = {
|
frappe.route_options = {
|
||||||
@ -318,13 +318,14 @@ frappe.ui.form.on("BOM", {
|
|||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
|
||||||
update_cost: function(frm) {
|
update_cost: function(frm, save_doc=false) {
|
||||||
return frappe.call({
|
return frappe.call({
|
||||||
doc: frm.doc,
|
doc: frm.doc,
|
||||||
method: "update_cost",
|
method: "update_cost",
|
||||||
freeze: true,
|
freeze: true,
|
||||||
args: {
|
args: {
|
||||||
update_parent: true,
|
update_parent: true,
|
||||||
|
save: save_doc,
|
||||||
from_child_bom: false
|
from_child_bom: false
|
||||||
},
|
},
|
||||||
callback: function(r) {
|
callback: function(r) {
|
||||||
|
@ -330,7 +330,7 @@ class BOM(WebsiteGenerator):
|
|||||||
frappe.get_doc("BOM", bom).update_cost(from_child_bom=True)
|
frappe.get_doc("BOM", bom).update_cost(from_child_bom=True)
|
||||||
|
|
||||||
if not from_child_bom:
|
if not from_child_bom:
|
||||||
frappe.msgprint(_("Cost Updated"))
|
frappe.msgprint(_("Cost Updated"), alert=True)
|
||||||
|
|
||||||
def update_parent_cost(self):
|
def update_parent_cost(self):
|
||||||
if self.total_cost:
|
if self.total_cost:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user