Skip to content

Commit 876aa76

Browse files
[FIX] hr: fix access error on language change
Backport of odoo#81474 Before odoo#86889 a regular user with employees in multiple companies was not able to change his own language due to a chain of event calling onchange on all the employee_ids and employee_ids on res.users being read as sudo. The fix does work but was wrong because it gave access to the user's public employee regardless of the active company_id A domain was added to employee_ids to make force the security rules even in sudo. closes odoo#94611 X-original-commit: 90cec40 Signed-off-by: Kevin Baptiste <[email protected]> Signed-off-by: William Braeckman (wbr) <[email protected]>
1 parent e2a7fc7 commit 876aa76

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
@@ -41,7 +41,7 @@
4141
<record id="hr_employee_public_comp_rule" model="ir.rule">
4242
<field name="name">Employee multi company rule</field>
4343
<field name="model_id" ref="model_hr_employee_public"/>
44-
<field name="domain_force">['|','|',('user_id', '=', user.id),('company_id', '=',False),('company_id', 'in', company_ids)]</field>
44+
<field name="domain_force">['|',('company_id', '=',False),('company_id', 'in', company_ids)]</field>
4545
</record>
4646

4747
<record id="hr_job_comp_rule" model="ir.rule">

0 commit comments

Comments
 (0)