From d5b06f78a5705c5539a7747e7607defae77b4a28 Mon Sep 17 00:00:00 2001 From: Anand Doshi Date: Tue, 6 Aug 2013 15:21:43 +0530 Subject: [PATCH] [fix] leave approver selection --- hr/doctype/employee/employee.js | 11 ++++++----- hr/doctype/leave_application/leave_application.js | 1 - 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/hr/doctype/employee/employee.js b/hr/doctype/employee/employee.js index 92dc7f986d..9ee7c618e6 100644 --- a/hr/doctype/employee/employee.js +++ b/hr/doctype/employee/employee.js @@ -30,11 +30,12 @@ erpnext.hr.EmployeeController = wn.ui.form.Controller.extend({ return this.frm.call({ method:"hr.utils.get_leave_approver_list", callback: function(r) { - me.frm.fields_dict.employee_leave_approvers.grid - .get_field("leave_approver").df.options = - $.map(r.message, function(profile) { - return {value: profile, label: wn.user_info(profile).fullname}; - }); + var df = wn.meta.get_docfield("Employee Leave Approver", "leave_approver", + me.frm.doc.name); + df.options = $.map(r.message, function(profile) { + return {value: profile, label: wn.user_info(profile).fullname}; + }); + me.frm.fields_dict.employee_leave_approvers.refresh(); } }); }, diff --git a/hr/doctype/leave_application/leave_application.js b/hr/doctype/leave_application/leave_application.js index 87264039c8..4c7d356c15 100755 --- a/hr/doctype/leave_application/leave_application.js +++ b/hr/doctype/leave_application/leave_application.js @@ -10,7 +10,6 @@ cur_frm.cscript.onload = function(doc, dt, dn) { cur_frm.set_value("status", "Open"); cur_frm.cscript.calculate_total_days(doc, dt, dn); } - cur_frm.set_df_property("leave_approver", "options", ""); return cur_frm.call({ method:"hr.utils.get_leave_approver_list", callback: function(r) {