[ux] bom fixes #3072
This commit is contained in:
parent
de9bd108d0
commit
5e7f8fd156
@ -8,8 +8,7 @@ cur_frm.cscript.refresh = function(doc,dt,dn){
|
||||
toggle_operations(cur_frm);
|
||||
|
||||
if (!doc.__islocal && doc.docstatus<2) {
|
||||
cur_frm.add_custom_button(__("Update Cost"), cur_frm.cscript.update_cost,
|
||||
"icon-money", "btn-default");
|
||||
cur_frm.add_custom_button(__("Update Cost"), cur_frm.cscript.update_cost);
|
||||
}
|
||||
}
|
||||
|
||||
@ -17,6 +16,7 @@ cur_frm.cscript.update_cost = function() {
|
||||
return frappe.call({
|
||||
doc: cur_frm.doc,
|
||||
method: "update_cost",
|
||||
freeze: true,
|
||||
callback: function(r) {
|
||||
if(!r.exc) cur_frm.refresh_fields();
|
||||
}
|
||||
|
@ -141,6 +141,8 @@ class BOM(Document):
|
||||
self.calculate_cost()
|
||||
self.save()
|
||||
|
||||
frappe.msgprint(_("Cost Updated"))
|
||||
|
||||
def get_bom_unitcost(self, bom_no):
|
||||
bom = frappe.db.sql("""select name, total_cost/quantity as unit_cost from `tabBOM`
|
||||
where is_active = 1 and name = %s""", bom_no, as_dict=1)
|
||||
|
Loading…
x
Reference in New Issue
Block a user