From 1f795a2d5ac3d83dcce1fcdaf7fff561adefaa49 Mon Sep 17 00:00:00 2001 From: "Lucas Perais (lpe)" Date: Fri, 2 Dec 2016 13:34:08 +0100 Subject: [PATCH] [FIX] hr_holidays: notifications: This commit corrects the behavior of notifications. The actions on notifications are appended to an empty list [FIX] hr_holidays: appending actions on notifications Closes #14565 Related to ticket 695738 --- addons/hr_holidays/models/hr_holidays.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/addons/hr_holidays/models/hr_holidays.py b/addons/hr_holidays/models/hr_holidays.py index dc515716ca8..a9b45c1aec0 100644 --- a/addons/hr_holidays/models/hr_holidays.py +++ b/addons/hr_holidays/models/hr_holidays.py @@ -559,12 +559,13 @@ class Holidays(models.Model): groups = super(Holidays, self)._notification_recipients(message, groups) self.ensure_one() + hr_actions = [] if self.state == 'confirm': app_action = self._notification_link_helper('controller', controller='/hr_holidays/validate') - hr_actions = [{'url': app_action, 'title': _('Approve')}] + hr_actions += [{'url': app_action, 'title': _('Approve')}] if self.state in ['confirm', 'validate', 'validate1']: ref_action = self._notification_link_helper('controller', controller='/hr_holidays/refuse') - hr_actions = [{'url': ref_action, 'title': _('Refuse')}] + hr_actions += [{'url': ref_action, 'title': _('Refuse')}] new_group = ( 'group_hr_holidays_user', lambda partner: bool(partner.user_ids) and any(user.has_group('hr_holidays.group_hr_holidays_user') for user in partner.user_ids), {