Files
odoo-usability/hr_holidays_usability/hr_holidays_mail.xml
Alexis de Lattre 348e0205a0 Add traking on warn fields
WORK IN PROGRESS: port hr_holidays_usability
2017-04-05 19:22:01 +02:00

56 lines
2.5 KiB
XML

<?xml version="1.0" encoding="utf-8"?>
<odoo>
<record id="email_template_hr_holidays" model="mail.template">
<field name="name">Holidays email template</field>
<field name="model_id" ref="hr_holidays.model_hr_holidays"/>
<field name="email_from">${user.company_id.email}</field>
<field name="email_to">${object.employee_id.parent_id.user_id.email or ''}</field>
<field name="email_cc">${object.employee_id.user_id.email or ''}</field>
<field name="reply_to">${user.email or ''}</field>
<field name="subject">${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 ''}</field>
<field name="auto_delete" eval="False"/>
<field name="lang">${user.lang}</field>
<field name="body_html"><![CDATA[
<div style="font-family: 'Lucica Grande', Ubuntu, Arial, Verdana, sans-serif; font-size: 12px; color: rgb(34, 34, 34); background-color: #FFF; ">
% if ctx.get('dbname') and 'prod' not in ctx.get('dbname'):
<p>WARNING : THIS IS A TEST E-MAIL sent from a test Odoo database (${ctx.get('dbname')}). Do not take into account !</p>
% endif
<p>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 ''} :</p>
<ul>
<li>Employee : ${object.employee_id.name or ''}</li>
% if object.employee_id.parent_id:
<li>Employee's manager : ${object.employee_id.parent_id.name or ''}</li>
% endif
% if object.type == 'remove':
<li>Start date : ${object.vacation_date_from or ''} ${object.vacation_time_from or ''}</li>
<li>End date : ${object.vacation_date_to or ''} ${object.vacation_time_to or ''}</li>
% endif
<li>Number of days : ${object.number_of_days < 0 and object.number_of_days * -1 or object.number_of_days}</li>
<li>Leave type : ${object.holiday_status_id.name or ''}</li>
<li>Public title : ${object.name or ''}</li>
<li>Notes for the manager : ${object.notes or ''}</li>
</ul>
% if ctx.get('wkf_tracker') == 'submitted':
% if object.type == 'remove':
<p>To validate or refuse it, go to the menu Human Resources > Leaves > Leave requests to approve.</p>
% else:
<p>To validate or refuse it, go to the menu Human Resources > Leaves > Allocation requests.</p>
% endif
% endif
<p>
-- <br/>
Automatic e-mail sent by Odoo. Do not reply.<br/>
Database : ${ctx.get('dbname')}<br/>
</p>
</div>
]]></field>
</record>
</odoo>