diff --git a/addons/hr_holidays/models/hr_leave.py b/addons/hr_holidays/models/hr_leave.py index 23baa422cd8..b112c02b2df 100644 --- a/addons/hr_holidays/models/hr_leave.py +++ b/addons/hr_holidays/models/hr_leave.py @@ -411,7 +411,7 @@ class HolidaysRequest(models.Model): for holiday in self: validation_type = holiday.holiday_status_id.validation_type manager = holiday.employee_id.parent_id or holiday.employee_id.department_id.manager_id - if (validation_type in ['manager', 'both']) and (manager and manager != current_employee)\ + if (validation_type in ['hr', 'both']) and (manager and manager != current_employee)\ and not self.env.user.has_group('hr_holidays.group_hr_holidays_manager'): raise UserError(_('You must be %s manager to approve this leave') % (holiday.employee_id.name)) elif validation_type == 'manager' and not self.env.user.has_group('hr_holidays.group_hr_holidays_manager'): diff --git a/addons/hr_holidays/security/hr_holidays_security.xml b/addons/hr_holidays/security/hr_holidays_security.xml index af0e4126893..5b5c4eeb8da 100644 --- a/addons/hr_holidays/security/hr_holidays_security.xml +++ b/addons/hr_holidays/security/hr_holidays_security.xml @@ -38,7 +38,7 @@ Leaves Officer - [('employee_id.company_id', 'child_of', user.company_id.id)] + ['|','|','|', ('employee_id.user_id', '=', user.id), ('department_id', '=', False), ('department_id.manager_id', '=', False), ('department_id.manager_id.user_id', '=', user.id)]