Skip to content
Snippets Groups Projects
Commit 1e1b9b40 authored by Meghna Jaswani's avatar Meghna Jaswani Committed by Yannick Tivisse
Browse files

[FIX] hr_holidays: Include manager (parent_id) as valid responsible


On a time off request, if the 'Time Off Responsible' (leave_manager_id)
is not set, then the SUPERUSER_ID is taken as time off responsible for the
validation.

Before falling back on OdooBot, include the parent_id of the employee,
aka the manager, as a valid responsible.

closes odoo/odoo#37506

Task: 2072111
Signed-off-by: default avatarYannick Tivisse (yti) <yti@odoo.com>
parent 1bf90d89
No related branches found
No related tags found
No related merge requests found
......@@ -917,6 +917,8 @@ class HolidaysRequest(models.Model):
if self.validation_type == 'manager' or (self.validation_type == 'both' and self.state == 'confirm'):
if self.employee_id.leave_manager_id:
responsible = self.employee_id.leave_manager_id
elif self.employee_id.parent_id.user_id:
responsible = self.employee_id.parent_id.user_id
elif self.validation_type == 'hr' or (self.validation_type == 'both' and self.state == 'validate1'):
if self.holiday_status_id.responsible_id:
responsible = self.holiday_status_id.responsible_id
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment