select leave approver by fullname in leave application

This commit is contained in:
Anand Doshi 2013-02-13 19:49:42 +05:30
parent 223072be02
commit 5070224079
2 changed files with 10 additions and 1 deletions

View File

@ -1,4 +1,9 @@
erpnext.updates = [
["13th February, 2013", [
"Employee: If Employee is linked to a Profile, copy Full Name, Date of Birth, \
Image and Gender to Profile",
"Leave Application: Select Leave Approver by their Full Name",
]],
["6th February, 2013", [
"Bookmarks: Add bookmarks via toolbar by clicking on the <i class='icon-star'></i> sign.",
]],

View File

@ -23,10 +23,14 @@ cur_frm.cscript.onload = function(doc, dt, dn) {
if(doc.__islocal) {
cur_frm.set_value("status", "Open")
}
cur_frm.set_df_property("leave_approver", "options", "");
cur_frm.call({
method:"get_approver_list",
callback: function(r) {
cur_frm.set_df_property("leave_approver", "options", r.message);
cur_frm.set_df_property("leave_approver", "options", $.map(r.message,
function(profile) {
return {value: profile, label: wn.user_info(profile).fullname};
}));
cur_frm.cscript.get_leave_balance(cur_frm.doc);
}
});