Skip to Content
Menu
This question has been flagged
7 Replies
2620 Views

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
Discard

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

Author 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
Discard
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
Discard
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
Discard
Author

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?

Author

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

Related Posts Replies Views Activity
2
Jul 24
939
1
Jun 24
3560
1
Oct 23
8578
1
Oct 23
97
1
Aug 23
2192