[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#39041

Task: 2072111
X-original-commit: 1e1b9b4089736ee8f7ef374c663376d040372ffd
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
This commit is contained in:
Meghna Jaswani
2019-10-18 13:51:29 +00:00
committed by fw-bot
parent 9ba8734f15
commit 548c2a03a0
+2
View File
@@ -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