Merge pull request #19585 from frappe/leave-approver-employee-fix

fix: fetch approver from employee
This commit is contained in:
Mangesh-Khairnar 2019-11-14 19:28:22 +05:30 committed by GitHub
commit f1e6387fab
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -21,7 +21,7 @@ def get_approvers(doctype, txt, searchfield, start, page_len, filters):
department_list = [] department_list = []
employee = frappe.get_value("Employee", filters.get("employee"), ["department", "leave_approver"], as_dict=True) employee = frappe.get_value("Employee", filters.get("employee"), ["department", "leave_approver"], as_dict=True)
if employee.leave_approver: if employee.leave_approver:
approver = frappe.db.get_value("User", leave_approver, ['name', 'first_name', 'last_name']) approver = frappe.db.get_value("User", employee.leave_approver, ['name', 'first_name', 'last_name'])
approvers.append(approver) approvers.append(approver)
return approvers return approvers