Skip to Content
Menu
Musisz się zarejestrować, aby móc wchodzić w interakcje z tą społecznością.
To pytanie dostało ostrzeżenie
7 Odpowiedzi
3147 Widoki

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 ?

Awatar
Odrzuć

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

Autor Najlepsza odpowiedź

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)] 

Awatar
Odrzuć
Najlepsza odpowiedź

 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.                  

Awatar
Odrzuć
Najlepsza odpowiedź

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

Awatar
Odrzuć
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

Powiązane posty Odpowiedzi Widoki Czynność
2
lip 24
3078
1
cze 24
5475
1
paź 23
11328
1
paź 23
98
1
sie 23
2194