Skip ke Konten
Menu
Pertanyaan ini telah diberikan tanda
7 Replies
3037 Tampilan

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
Buang

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

Penulis Jawaban Terbai

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
Buang
Jawaban Terbai

 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
Buang
Jawaban Terbai

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
Buang
Penulis

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?

Penulis

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

Post Terkait Replies Tampilan Aktivitas
2
Jul 24
2677
1
Jun 24
5140
1
Okt 23
10849
1
Okt 23
98
1
Agu 23
2193