From 73cad7601085e8dac731eafc4a11cab63ef91f82 Mon Sep 17 00:00:00 2001 From: Neil Trini Lasrado Date: Tue, 13 Jan 2015 13:55:34 +0530 Subject: [PATCH] dirty code cleanup --- erpnext/manufacturing/doctype/bom/bom.js | 36 +++++++++---------- .../doctype/workstation/workstation.js | 18 +++++----- 2 files changed, 27 insertions(+), 27 deletions(-) diff --git a/erpnext/manufacturing/doctype/bom/bom.js b/erpnext/manufacturing/doctype/bom/bom.js index 2ac11dce01..19c3fcff6b 100644 --- a/erpnext/manufacturing/doctype/bom/bom.js +++ b/erpnext/manufacturing/doctype/bom/bom.js @@ -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); - } - }) + } + }) }); diff --git a/erpnext/manufacturing/doctype/workstation/workstation.js b/erpnext/manufacturing/doctype/workstation/workstation.js index 17320520af..223e768ebb 100644 --- a/erpnext/manufacturing/doctype/workstation/workstation.js +++ b/erpnext/manufacturing/doctype/workstation/workstation.js @@ -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); + } + } + }) }