From ad68d64d939d77749ba7f2ee129886be7c1c0803 Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Thu, 15 May 2014 19:33:27 +0530 Subject: [PATCH] Leave approver select options in leave application and employee --- .../employee_leave_approver.json | 10 +++++++--- .../hr/doctype/leave_application/leave_application.js | 2 ++ .../doctype/leave_application/leave_application.json | 6 +++--- 3 files changed, 12 insertions(+), 6 deletions(-) diff --git a/erpnext/hr/doctype/employee_leave_approver/employee_leave_approver.json b/erpnext/hr/doctype/employee_leave_approver/employee_leave_approver.json index c0cb78d894..0302bc95fa 100644 --- a/erpnext/hr/doctype/employee_leave_approver/employee_leave_approver.json +++ b/erpnext/hr/doctype/employee_leave_approver/employee_leave_approver.json @@ -1,7 +1,7 @@ { "allow_import": 0, "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", "docstatus": 0, "doctype": "DocType", @@ -11,6 +11,7 @@ "fieldtype": "Select", "in_list_view": 1, "label": "Leave Approver", + "options": "[Select]", "permlevel": 0, "print_hide": 1, "reqd": 1, @@ -19,9 +20,12 @@ ], "idx": 1, "istable": 1, - "modified": "2013-12-20 19:23:12.000000", + "modified": "2014-05-15 19:32:14.134420", "modified_by": "Administrator", "module": "HR", "name": "Employee Leave Approver", - "owner": "Administrator" + "owner": "Administrator", + "permissions": [], + "sort_field": "modified", + "sort_order": "DESC" } \ No newline at end of file diff --git a/erpnext/hr/doctype/leave_application/leave_application.js b/erpnext/hr/doctype/leave_application/leave_application.js index 3ce7a5bc47..acb91c6bbf 100755 --- a/erpnext/hr/doctype/leave_application/leave_application.js +++ b/erpnext/hr/doctype/leave_application/leave_application.js @@ -19,7 +19,9 @@ cur_frm.cscript.onload = function(doc, dt, dn) { function(user) { return {value: user, label: frappe.user_info(user).fullname}; })); + if(leave_approver) cur_frm.set_value("leave_approver", leave_approver); + cur_frm.cscript.get_leave_balance(cur_frm.doc); } }); diff --git a/erpnext/hr/doctype/leave_application/leave_application.json b/erpnext/hr/doctype/leave_application/leave_application.json index 581ee2a6b4..eb9b23921a 100644 --- a/erpnext/hr/doctype/leave_application/leave_application.json +++ b/erpnext/hr/doctype/leave_application/leave_application.json @@ -20,9 +20,9 @@ { "description": "Leave can be approved by users with Role, \"Leave Approver\"", "fieldname": "leave_approver", - "fieldtype": "Link", + "fieldtype": "Select", "label": "Leave Approver", - "options": "User", + "options": "[Select]", "permlevel": 0 }, { @@ -182,7 +182,7 @@ "idx": 1, "is_submittable": 1, "max_attachments": 3, - "modified": "2014-05-09 02:17:13.936705", + "modified": "2014-05-15 19:30:47.331357", "modified_by": "Administrator", "module": "HR", "name": "Leave Application",