I created a workflow for leave approvals that works like this: First, the leave must be approved by the leave approver assigned to each employee, then it goes to the Dashboard Manager, and finally to HR. In my case, the Dashboard Manager has access to all employees, and he is also the leave approver for some employees. So, I gave him permission as a leave approver.
Now, when an employee from the technical section, for example, applies for leave, the Dashboard Manager can approve it as a leave approver (even though he is not the assigned approver for that employee) and also as the Dashboard Manager.
Thank very much my friend @ejaaz for your interest and assist.
I just edit your code to this frappe.session.user == frappe.db.get_value(“Employee”, {“name”: doc.employee}, “leave_approver”)
and that’s solve my problem.