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

<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'))]"/>
</record>


https://github.com/odoo/odoo/blob/9.0/addons/hr_holidays/security/ir_rule.xml

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?
Awatar
Odrzuć
Najlepsza odpowiedź

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

Awatar
Odrzuć
Powiązane posty Odpowiedzi Widoki Czynność
1
lip 18
4345
3
sie 17
6612
0
kwi 24
4802
2
gru 15
3978
0
gru 15
3411