Odoo Aide

0

0
8 Réponses
0
Dhouha Tunisie
25/06/2019 06:32

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

0
Avatar

Niyas Raphy Inde

--Niyas Raphy--
25702
| 7 7 11
Wayanad, Kerala, Inde
--Niyas Raphy--

Odoo Techno Functionalist

Feel free to connect :  niyasraphyk@gmail.com

Twitter:https://twitter.com/niyasraphy
LinkedIn: https://www.linkedin.com/in/niyasraphy/
FB:https://www.facebook.com/niyasraphy123
Whatsapp : +917736136763
Happy to help :)

Niyas Raphy Inde
19/06/2019 09:58

Hi,

If this is the situation what you can do is that, either add a record rule for the leaves such a way that the managers only see his employee leave requests or you can override the action of the approval button and check whether the approving user is the manager of the leave requested employees manager or not and raise the warning message.


Thanks

4 Commentaires
Dhouha Tunisie
19/06/2019 10:57

Thanks, but can i create a record rule which allows managers to see their own employees only

Niyas Raphy Inde
19/06/2019 11:46

Yes as described in answer, either create record rule or override the button action and make changes

Dhouha Tunisie
20/06/2019 04:26

What should i write in the domain filter ?

Niyas Raphy Inde
20/06/2019 06:11

'employee_id.parent_id.user_id', '=', user.id

0
Avatar

Mihran Thalhath Inde

--Mihran Thalhath--
8243
| 3 2 7
Calicut, Inde
--Mihran Thalhath--

LinkedIn - https://www.linkedin.com/in/mihran-thalhath-020157170 GitHub - https://github.com/mihranz7

Mihran Thalhath Inde
19/06/2019 11:47

Hi Dhouha,


As Niyas said you can create a new record rule and disable the current rule for Leaves/Manager for hr.leave object. I guess "[('department_id.member_ids.user_id', '=', user.id)]" domain will work fine. You can also modify the action_approve() method to check for the current user's department and raise an error. I will prefer the first method since department heads should not be able to see the leaves of employees who are not in their department.


Mihran

1 Commentaires
Sehrish Pakistan
25/06/2019 06:13

Check this customization tips: https://goo.gl/8HgnCF

Poser une question
Writer
Étiquette
Keep Informed
1 Abonné(e)s
About This Community

This platform is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.

Register
Odoo Training Center

Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.

Test it now