Odoo Help

0

0
8 Answers
0
Dhouha
25/06/19 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

--Niyas Raphy--
24489
| 7 7 11
Wayanad, Índia
--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

Happy to help :)

Niyas Raphy
19/06/19 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 Comments
Dhouha
19/06/19 10:57

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

Niyas Raphy
19/06/19 11:46

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

Dhouha
20/06/19 04:26

What should i write in the domain filter ?

Niyas Raphy
20/06/19 06:11

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

0
Avatar

Mihran Thalhath

--Mihran Thalhath--
8023
| 3 2 6
Calicut, Índia
--Mihran Thalhath--

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

Mihran Thalhath
19/06/19 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 Comment
Sehrish
25/06/19 06:13

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

Ask a Question
Writer
Tag
Keep Informed
1 follower(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 eLearning platform and experience all Odoo Apps through learning videos, use cases and quizzes.

Test it now