'Handle HR users and officers recipients that can validate or refuse holidays
directly from email.'

@api.multi
def _notification_recipients(self, message, groups):

    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')}]
    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')}]
    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)))), {'actions': hr_actions})
    return ([new_group] + groups)
