[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) <sgv@odoo.com> Signed-off-by: Thomas Lefebvre (thle) <thle@odoo.com>
This commit is contained in:
@@ -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({
|
||||
|
||||
Reference in New Issue
Block a user