odoo/odoo#94592

Created by fw-bot
Merged at 1823e5c3b8e5290656a7cb2e7aa3145e2192e704

Statuses:

label
odoo-dev:15.0-14.0-fix-public-employee-ir-rule-wbr-1v9c-fw
head
5e970a59c7a85a1f975ad0d7d17ccb0ea5a4cf12
merged
3 years ago by William Braeckman (wbr)
odoo/odoo
14.0 #94558
15.0 #94592
saas-15.1 #94602
saas-15.2 #94607
saas-15.3 #94611
saas-15.4 #94615
16.0
17.0
18.0
saas-18.2
saas-18.3
saas-18.4
19.0
master #94618

[FW][FIX] hr: fix access error on language change

Backport of #81474
Before #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.

Forward-Port-Of: #94558