[FIX] hr_attendance: multi-company rule

Before this commit, a user with attendance administrator rights can see
the attendances of all users of all companies and not only the companies
he is allowed.

Now, the administrator will only see the attendances of the users of the
companies he is allowed.

opw-2263577

closes odoo/odoo#52355

X-original-commit: 0e8f86795db74fe21daa8776243415291371fdf6
Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
Signed-off-by: Jorge Pinna Puissant (jpp) <jpp@odoo.com>
This commit is contained in:
Jorge Pinna Puissant
2020-06-03 12:32:19 +00:00
parent 5ee61b4af1
commit 23b0f38245
@@ -45,7 +45,14 @@
<field name="comment">The user will have to enter his PIN to check in and out manually at the company screen.</field>
</record>
<data noupdate="1">
<data noupdate="1">
<record id="hr_attendance_rule_employee_company" model="ir.rule">
<field name="name">Employee multi company rule</field>
<field name="model_id" ref="model_hr_attendance"/>
<field name="global" eval="True"/>
<field name="domain_force">['|',('employee_id.company_id','=',False),('employee_id.company_id', 'in', company_ids)]</field>
</record>
<record id="hr_attendance_rule_attendance_manager" model="ir.rule">
<field name="name">attendance officer: full access</field>