Search code examples
odooodoo-10odoo-11

Add Record Rules to leave request Odoo


I have used the following rule:

[
  '|',
  ('employee_id.user_id',
  '=',
  user.id),
  ('employee_id.parent_id.user_id',
  '=',
  user.id)
]

to only allow employees to view their leave applications and have only managers see the subordinates leave applications. However, while applying this rule to everyone (Globally), I would like to still have HR Managers (those given Manager roles i believe its base.group_hr_manager in the module) to be able to see every ones leave request ?


Solution

  • Don't apply this rule to everyone but instead to base.group_user which is normal users group anyway. Or better: override/extend the domain of both already existing rules Employee Holidays *. And there already is a rule for "higher" access groups called Holidays Officer which provides HR Officer and HR Manager groups all rights for every leave/holiday.