Leave approver select options in leave application and employee

This commit is contained in:
Nabin Hait 2014-05-15 19:33:27 +05:30
parent fa7444ec94
commit ad68d64d93
3 changed files with 12 additions and 6 deletions

View File

@ -1,7 +1,7 @@
{ {
"allow_import": 0, "allow_import": 0,
"autoname": "LAPPR-/.#####", "autoname": "LAPPR-/.#####",
"creation": "2013-04-12 06:56:15.000000", "creation": "2013-04-12 06:56:15",
"description": "Users who can approve a specific employee's leave applications", "description": "Users who can approve a specific employee's leave applications",
"docstatus": 0, "docstatus": 0,
"doctype": "DocType", "doctype": "DocType",
@ -11,6 +11,7 @@
"fieldtype": "Select", "fieldtype": "Select",
"in_list_view": 1, "in_list_view": 1,
"label": "Leave Approver", "label": "Leave Approver",
"options": "[Select]",
"permlevel": 0, "permlevel": 0,
"print_hide": 1, "print_hide": 1,
"reqd": 1, "reqd": 1,
@ -19,9 +20,12 @@
], ],
"idx": 1, "idx": 1,
"istable": 1, "istable": 1,
"modified": "2013-12-20 19:23:12.000000", "modified": "2014-05-15 19:32:14.134420",
"modified_by": "Administrator", "modified_by": "Administrator",
"module": "HR", "module": "HR",
"name": "Employee Leave Approver", "name": "Employee Leave Approver",
"owner": "Administrator" "owner": "Administrator",
"permissions": [],
"sort_field": "modified",
"sort_order": "DESC"
} }

View File

@ -19,7 +19,9 @@ cur_frm.cscript.onload = function(doc, dt, dn) {
function(user) { function(user) {
return {value: user, label: frappe.user_info(user).fullname}; return {value: user, label: frappe.user_info(user).fullname};
})); }));
if(leave_approver) cur_frm.set_value("leave_approver", leave_approver); if(leave_approver) cur_frm.set_value("leave_approver", leave_approver);
cur_frm.cscript.get_leave_balance(cur_frm.doc); cur_frm.cscript.get_leave_balance(cur_frm.doc);
} }
}); });

View File

@ -20,9 +20,9 @@
{ {
"description": "Leave can be approved by users with Role, \"Leave Approver\"", "description": "Leave can be approved by users with Role, \"Leave Approver\"",
"fieldname": "leave_approver", "fieldname": "leave_approver",
"fieldtype": "Link", "fieldtype": "Select",
"label": "Leave Approver", "label": "Leave Approver",
"options": "User", "options": "[Select]",
"permlevel": 0 "permlevel": 0
}, },
{ {
@ -182,7 +182,7 @@
"idx": 1, "idx": 1,
"is_submittable": 1, "is_submittable": 1,
"max_attachments": 3, "max_attachments": 3,
"modified": "2014-05-09 02:17:13.936705", "modified": "2014-05-15 19:30:47.331357",
"modified_by": "Administrator", "modified_by": "Administrator",
"module": "HR", "module": "HR",
"name": "Leave Application", "name": "Leave Application",