From b4f77a536210e769fe74c86703f3318207c2fe9d Mon Sep 17 00:00:00 2001 From: William Braeckman Date: Fri, 24 Jun 2022 13:46:47 +0000 Subject: [PATCH] [FIX] hr: fix access error on language change Backport of odoo/odoo#81474 Before odoo/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/odoo#94618 X-original-commit: 90cec4073e065c142043fcea1d68a10c7cb72e73 Signed-off-by: Kevin Baptiste Signed-off-by: William Braeckman (wbr) --- addons/hr/security/hr_security.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/hr/security/hr_security.xml b/addons/hr/security/hr_security.xml index f080b19c512..0992af253a6 100644 --- a/addons/hr/security/hr_security.xml +++ b/addons/hr/security/hr_security.xml @@ -40,7 +40,7 @@ Employee multi company rule - ['|','|',('user_id', '=', user.id),('company_id', '=',False),('company_id', 'in', company_ids)] + ['|',('company_id', '=',False),('company_id', 'in', company_ids)]