dirty code cleanup
This commit is contained in:
parent
d68115645f
commit
73cad76010
@ -187,33 +187,33 @@ cur_frm.cscript.validate = function(doc, dt, dn) {
|
||||
frappe.ui.form.on("BOM Operation", "operation", function(frm, cdt, cdn) {
|
||||
var d = locals[cdt][cdn];
|
||||
|
||||
frappe.call({
|
||||
"method": "frappe.client.get",
|
||||
args: {
|
||||
doctype: "Operation",
|
||||
name: d.operation
|
||||
},
|
||||
callback: function (data) {
|
||||
frappe.call({
|
||||
"method": "frappe.client.get",
|
||||
args: {
|
||||
doctype: "Operation",
|
||||
name: d.operation
|
||||
},
|
||||
callback: function (data) {
|
||||
frappe.model.set_value(d.doctype, d.name, "opn_description", data.message.opn_description);
|
||||
frappe.model.set_value(d.doctype, d.name, "workstation", data.message.workstation);
|
||||
erpnext.bom.set_operation(frm.doc);
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
});
|
||||
|
||||
frappe.ui.form.on("BOM Operation", "workstation", function(frm, cdt, cdn) {
|
||||
var d = locals[cdt][cdn];
|
||||
|
||||
frappe.call({
|
||||
"method": "frappe.client.get",
|
||||
args: {
|
||||
doctype: "Workstation",
|
||||
name: d.workstation
|
||||
},
|
||||
callback: function (data) {
|
||||
frappe.call({
|
||||
"method": "frappe.client.get",
|
||||
args: {
|
||||
doctype: "Workstation",
|
||||
name: d.workstation
|
||||
},
|
||||
callback: function (data) {
|
||||
frappe.model.set_value(d.doctype, d.name, "hour_rate", data.message.hour_rate);
|
||||
erpnext.bom.calculate_op_cost(frm.doc);
|
||||
erpnext.bom.calculate_total(frm.doc);
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
});
|
||||
|
@ -5,13 +5,13 @@
|
||||
|
||||
//--------- ONLOAD -------------
|
||||
cur_frm.cscript.onload = function(doc, cdt, cdn) {
|
||||
frappe.call({
|
||||
type:"GET",
|
||||
method:"erpnext.manufacturing.doctype.workstation.workstation.get_default_holiday_list",
|
||||
callback: function(r) {
|
||||
if(!r.exe && r.message){
|
||||
cur_frm.set_value("holiday_list", r.message);
|
||||
}
|
||||
}
|
||||
})
|
||||
frappe.call({
|
||||
type:"GET",
|
||||
method:"erpnext.manufacturing.doctype.workstation.workstation.get_default_holiday_list",
|
||||
callback: function(r) {
|
||||
if(!r.exe && r.message){
|
||||
cur_frm.set_value("holiday_list", r.message);
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user