Skip to Content
Menú
This question has been flagged
7 Respostes
3030 Vistes

i'm using odoo 11 and i have many managers in the same department and i want that every manager see and approve the requests of his own employees only. How can i resolve this problem ? Any idea please ?

Avatar
Descartar

Show records on TreeView that are related to Active User Department: https://goo.gl/F42kRf

Autor Best Answer

i found the solution i should create a new record rule with the domain filter ['|',('employee_id.user_id','=',user.id),('employee_id.parent_id.user_id','=',user.id)] 

Avatar
Descartar
Best Answer

 Hi,

   we can add the manager in the employee master.Add this condition to check whether he is manager or not employee_id.parent_id.user_id.id = self._uid if this condition satisfy he can approve the request other wise raise a warning.                  

Avatar
Descartar
Best Answer

Hi Dhouha,



I am seeing the same question from you for the third time i guess. So I will repeat my answer one more time. You can either raise a warning when a manager tries to approve leaves of users who are not in his department. To do this you may use super on approve method in hr_holidays. 


Second and better way to do what you wish is to add record rules so that managers can see leaves of his employee only. Since you need to changes rules of Leaves/Manager, delete the exiting rules for that group in hr_holidays object. Then add a new record rule "[('department_id.member_ids.user_id', '=', user.id)]" and give this as domain. 



Mihran

Avatar
Descartar
Autor

Thanks Mihran, i repost this question because i tried all the answer but always i don't get the result that i want. I even try your answer on the model hr.holidays but it always display all the leaves request by all the employees

Hi Dhouha,

Have you disabled the other record rules for that group for the same object?

Autor

Yes , for this group there is one rule which is my rule

Related Posts Respostes Vistes Activitat
2
de jul. 24
2665
1
de juny 24
5137
1
d’oct. 23
10845
1
d’oct. 23
98
1
d’ag. 23
2193