Skip to content

Commit

Permalink
[FIX] #22 adapt hr.employee.public rules
Browse files Browse the repository at this point in the history
fixes #22
  • Loading branch information
hbrunn committed Sep 25, 2023
1 parent f63ec5d commit dcc66a1
Showing 1 changed file with 16 additions and 2 deletions.
18 changes: 16 additions & 2 deletions verdigado_attendance/security/verdigado_attendance.xml
Original file line number Diff line number Diff line change
Expand Up @@ -30,15 +30,29 @@
</field>
<field name="model_id" ref="hr.model_hr_employee_public" />
<field name="domain_force">
[('department_id', 'child_of', user.employee_id.department_id.id) if
user.employee_id.department_id else ('id', '=', user.employee_id.id)]
['|', '|', ('department_id', 'child_of', user.employee_id.department_id.id)
if
user.employee_id.department_id else ('id', '=', user.employee_id.id),
('employee_id','child_of',user.employee_ids.ids),
('employee_id','parent_of',user.employee_ids.ids),
]
</field>
<field name="perm_read" eval="True" />
<field name="perm_write" eval="True" />
<field name="perm_create" eval="True" />
<field name="perm_unlink" eval="True" />
<field name="groups" eval="[(4, ref('base.group_user'))]" />
</record>
<record id="rule_hr_employee_public_manager" model="ir.rule">
<field name="name">Lift restrictions for HR managers</field>
<field name="model_id" ref="hr.model_hr_employee_public" />
<field name="domain_force">[(1, '=', 1)]</field>
<field name="perm_read" eval="True" />
<field name="perm_write" eval="True" />
<field name="perm_create" eval="True" />
<field name="perm_unlink" eval="True" />
<field name="groups" eval="[(4, ref('hr.group_hr_manager'))]" />
</record>

<!-- hr.attendance -->
<record id="hr_attendance.hr_attendance_rule_attendance_manager" model="ir.rule">
Expand Down

0 comments on commit dcc66a1

Please sign in to comment.