dirty code cleanup

This commit is contained in:
Neil Trini Lasrado 2015-01-13 13:55:34 +05:30
parent d68115645f
commit 73cad76010
2 changed files with 27 additions and 27 deletions

View File

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

View File

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