From d33c44e3a5abce71a3af3ce18b3ab5a9a569aaf6 Mon Sep 17 00:00:00 2001 From: Kanchan Chauhan Date: Mon, 21 Nov 2016 11:23:01 +0530 Subject: [PATCH] [Fix]Workstation holiday list --- .../doctype/workstation/workstation.js | 28 ++++++++++--------- 1 file changed, 15 insertions(+), 13 deletions(-) diff --git a/erpnext/manufacturing/doctype/workstation/workstation.js b/erpnext/manufacturing/doctype/workstation/workstation.js index 153d7e5623..ba8e30cba0 100644 --- a/erpnext/manufacturing/doctype/workstation/workstation.js +++ b/erpnext/manufacturing/doctype/workstation/workstation.js @@ -1,17 +1,19 @@ // Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors // License: GNU General Public License v3. See license.txt - - -//--------- 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.ui.form.on("Workstation", { + onload: function(frm) { + if(frm.is_new()) + { + 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); + } + } + }) } - }) -} + } +}) \ No newline at end of file