From 497e2296c7ffd073a282802a9ab99e85fdfbdaa6 Mon Sep 17 00:00:00 2001 From: "Thomas Lefebvre (thle)" Date: Thu, 7 Sep 2023 15:37:15 +0200 Subject: [PATCH] [FIX] hr_holidays: create activity if leave has to be validated Issue: ------ When a leave is created, a notification is only sent if a "Time Off Officer" is defined (`responsible_ids`). However, if we choose the approval option with the value: "By Employee's Approver", the leave manager must be notified even if there is no "Time Off Officer". Solution: --------- Give the option of creating notifications in all cases where validation is required for the leave type. opw-3412841 closes odoo/odoo#135310 X-original-commit: 1428505b0aaf6a1d3cf778bdb6137bea9ec6283e Signed-off-by: Sofie Gvaladze (sgv) Signed-off-by: Thomas Lefebvre (thle) --- addons/hr_holidays/models/hr_leave.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/hr_holidays/models/hr_leave.py b/addons/hr_holidays/models/hr_leave.py index f6cec3e668b..7ce334421db 100644 --- a/addons/hr_holidays/models/hr_leave.py +++ b/addons/hr_holidays/models/hr_leave.py @@ -1555,7 +1555,7 @@ class HolidaysRequest(models.Model): if holiday.state == 'draft': to_clean |= holiday elif holiday.state == 'confirm': - if holiday.holiday_status_id.responsible_ids: + if holiday.holiday_status_id.leave_validation_type != 'no_validation': user_ids = holiday.sudo()._get_responsible_for_approval().ids or self.env.user.ids for user_id in user_ids: activity_vals.append({