odoo/odoo#94558

Created by William Braeckman (wbr)
Merged at 90cec4073e065c142043fcea1d68a10c7cb72e73

Statuses:

label
odoo-dev:14.0-fix-public-employee-ir-rule-wbr
head
a8b36d34f6f43d2f74a685fe2fbcdb842fe303e0
merged
3 years ago by Kevin Baptiste
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

[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.