Odoo Help


Why does a security rule allowing every employee to view leaves data of other employees?

Manvir Kaur
on 5/31/16, 11:47 AM 272 views

<record id="property_rule_holidays_employee" model="ir.rule">
<field name="name">Employee Holidays</field>
<field name="model_id" ref="model_hr_holidays"/>
<field name="domain_force">['|', ('employee_id.user_id','=',user.id), ('state', '=', 'validate')]</field>
<field name="perm_create" eval="False"/>
<field name="perm_write" eval="False"/>
<field name="perm_unlink" eval="False"/>
<field name="groups" eval="[(4,ref('base.group_user'))]"/>


Due to the state = validate condition that is added to the version 9, all employees can see data of others. Since, it is an or condition either of them can be true.

But what if I do not want all employees to view leaves of others but only their own?
Mark Ma
On 1/18/17, 12:25 AM

I tried to set the Rule 'Employee Holidays' of Group 'Human Resources / Employee' with below Rule Definition (Domain Filter) :

['|', ('employee_id.user_id','=',user.id), ('state', '=', 'validate1')]

Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

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.


Odoo Training Center

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

Test it now

Question tools

1 follower(s)


Asked: 5/31/16, 11:47 AM
Seen: 272 times
Last updated: 1/18/17, 12:25 AM