Auto-email confirmed leave context.update({ 'wkf_tracker': 'submitted', 'dbname': cr.dbname, }) if not object.no_email_notification: template_id=self.pool['ir.model.data'].get_object_reference(cr, uid, 'hr_holidays_usability', 'email_template_hr_holidays')[1] self.pool['email.template'].send_mail(cr, uid, template_id, object.id, context=context) code ir.actions.server True Auto-email validated leave context.update({ 'wkf_tracker': 'validated', 'dbname': cr.dbname, }) if not object.no_email_notification: template_id=self.pool['ir.model.data'].get_object_reference(cr, uid, 'hr_holidays_usability', 'email_template_hr_holidays')[1] self.pool['email.template'].send_mail(cr, uid, template_id, object.id, context=context) code ir.actions.server True Auto-email refused leave context.update({ 'wkf_tracker': 'refused', 'dbname': cr.dbname, }) if not object.no_email_notification: template_id=self.pool['ir.model.data'].get_object_reference(cr, uid, 'hr_holidays_usability', 'email_template_hr_holidays')[1] self.pool['email.template'].send_mail(cr, uid, template_id, object.id, context=context) code ir.actions.server True Holidays email template ${user.company_id.email} ${object.employee_id.parent_id.user_id.email or ''} ${object.employee_id.user_id.email or ''} ${user.email or ''} ${ctx.get('dbname') and 'prod' not in ctx.get('dbname') and '[TEST]' or ''}[${object.type == 'remove' and 'Leave' or 'Allocation'} ${ctx.get('wkf_tracker')}] ${object.name or ''} - ${object.employee_id.name or ''} ${user.lang} % if ctx.get('dbname') and 'prod' not in ctx.get('dbname'):

WARNING : THIS IS A TEST E-MAIL sent from a test Odoo database (${ctx.get('dbname')}). Do not take into account !

% endif

The following ${object.type == 'remove' and 'leave request' or 'ALLOCATION request (i.e. credit of days, not debit !)'} has been ${ctx.get('wkf_tracker') or 'ERROR'} today in Odoo by ${user.name or ''} :

  • Employee : ${object.employee_id.name or ''}
  • % if object.employee_id.parent_id:
  • Employee's manager : ${object.employee_id.parent_id.name or ''}
  • % endif % if object.type == 'remove':
  • Start date : ${object.vacation_date_from or ''} ${object.vacation_time_from or ''}
  • End date : ${object.vacation_date_to or ''} ${object.vacation_time_to or ''}
  • % endif
  • Number of days : ${object.number_of_days < 0 and object.number_of_days * -1 or object.number_of_days}
  • Leave type : ${object.holiday_status_id.name or ''}
  • Public title : ${object.name or ''}
  • Notes for the manager : ${object.notes or ''}
% if ctx.get('wkf_tracker') == 'submitted': % if object.type == 'remove':

To validate or refuse it, go to the menu Human Resources > Leaves > Leave requests to approve.

% else:

To validate or refuse it, go to the menu Human Resources > Leaves > Allocation requests.

% endif % endif

--
Automatic e-mail sent by Odoo. Do not reply.
Database : ${ctx.get('dbname')}

]]>