[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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user