Skip to content

Commit 0e12620

Browse files
author
Philippe Wauthy
committed
[FIX] hr: update accesss right for hr_employee
In a multi-company environment, it is not possible to update information (language, email,...) from My Profile. The security rule only allows to change information if the right company is selected or if the user has no company. Since a user assigned to several companies will have several records in hr_employee referring the same user_id, the security rule is now updated to allow updating information from the My Profile page if the hr_employee.user_id refers to the current user_id. task-2678411
1 parent 866143f commit 0e12620

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

addons/hr/security/hr_security.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
<record id="hr_employee_comp_rule" model="ir.rule">
3030
<field name="name">Employee multi company rule</field>
3131
<field name="model_id" ref="model_hr_employee"/>
32-
<field name="domain_force">['|',('company_id','=',False),('company_id', 'in', company_ids)]</field>
32+
<field name="domain_force">['|', '|',('company_id','=',False),('company_id', 'in', company_ids),('user_id', '=', user.id)]</field>
3333
</record>
3434

3535
<record id="hr_dept_comp_rule" model="ir.rule">

0 commit comments

Comments
 (0)