[fix] leave approver selection

This commit is contained in:
Anand Doshi 2013-08-06 15:21:43 +05:30
parent 41006c545e
commit d5b06f78a5
2 changed files with 6 additions and 6 deletions

View File

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

View File

@ -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) {