Files
odoo_source/addons/mail/data/mail_data.xml
T
Denis Ledoux 4bebbfdcf5 [FIX] mail: jinja2 code compatible with wysiwyg for notifications
When editing an email template with the wysiwyg,
the `<` and `>` operators are automatically converted
to `&lt;` and `&gt;`, even for the Jinja2 conditions,
therefore breaking these conditions, and the render
of the email templates.

We avoid to use these operators in the email
template, so users can customize the notification
email template without having an advanced
knowledge on how to edit an email template containing
Jinja2 code.

Besides, the line return at the end of the email template,
just after the `% endif`,
is done on purpose as well: the wysiwyg adds automatically,
at the time of this revision,
`<p></p>` at the end of the email template source, but
this cannot be added on the same line than `% endif`,
otherwise this is considered as Jinja2 code, and it's not.

opw-659113
2015-12-10 16:58:15 +01:00

164 lines
8.9 KiB
XML

<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data noupdate="1">
<record forcecreate="True" id="ir_cron_mail_scheduler_action" model="ir.cron">
<field name="name">Email Queue Manager</field>
<field name="user_id" ref="base.user_root"/>
<field name="interval_number">1</field>
<field name="interval_type">hours</field>
<field name="numbercall">-1</field>
<field eval="False" name="doall"/>
<field eval="'mail.mail'" name="model"/>
<field eval="'process_email_queue'" name="function"/>
<field eval="'()'" name="args"/>
</record>
<record id="ir_cron_module_update_notification" model="ir.cron">
<field name="name">Update Notification</field>
<field eval="True" name="active" />
<field name="user_id" ref="base.user_root" />
<field name="interval_number">1</field>
<field name="interval_type">weeks</field>
<field name="numbercall">-1</field>
<field name="nextcall" eval="(DateTime.now() + timedelta(days=7)).strftime('%Y-%m-%d %H:%M:%S')" />
<field eval="False" name="doall" />
<field eval="'publisher_warranty.contract'" name="model" />
<field eval="'update_notification'" name="function" />
<field eval="'(None,)'" name="args" />
<field name="priority">1000</field>
</record>
<!-- Admin should not receivve emails at creation -->
<record id="base.partner_root" model="res.partner">
<field name="notify_email">none</field>
</record>
<!-- Catchall Email Alias -->
<record id="icp_mail_catchall_alias" model="ir.config_parameter">
<field name="key">mail.catchall.alias</field>
<field name="value">catchall</field>
</record>
<!-- Discussion subtype for messaging / Chatter -->
<record id="mt_comment" model="mail.message.subtype">
<field name="name">Discussions</field>
<field name="sequence" eval="0"/>
</record>
<record id="mt_note" model="mail.message.subtype">
<field name="name">Note</field>
<field name="default" eval="False"/>
<field name="internal" eval="True"/>
<field name="sequence" eval="100"/>
</record>
</data>
<data>
<!--Default Notification Email template -->
<record id="mail_template_data_notification_email_default" model="mail.template">
<field name="name">Notification Email</field>
<field name="subject">${object.subject or (object.record_name and 'Re: %s' % object.record_name) or (object.parent_id and object.parent_id.subject and 'Re: %s' % object.parent_id.subject) or (object.parent_id and object.parent_id.record_name and 'Re: %s' % object.parent_id.record_name)}</field>
<field name="model_id" ref="mail.model_mail_message"/>
<field name="auto_delete" eval="True"/>
<field name="body_html"><![CDATA[
<div itemscope itemtype="http://schema.org/EmailMessage">
<div itemprop="potentialAction" itemscope itemtype="http://schema.org/ViewAction">
<link itemprop="target" href="${ctx['button_access']['url']}"/>
<link itemprop="url" href="${ctx['button_access']['url']}"/>
<meta itemprop="name" content="View ${ctx['model_name']}"/>
</div>
</div>
<div summary="o_mail_notification" style="padding:0px; width:600px; margin:0 auto; background: #FFFFFF repeat top /100%; color:#777777">
<table cellspacing="0" cellpadding="0" style="width:600px; border-collapse:collapse; background:inherit; color:inherit">
<tbody><tr>
<td valign="center" width="270" style="padding:5px 10px 5px 5px;font-size: 30px">
% if ctx.get('button_access'):
<a href="${ctx['button_access']['url']}" style="-webkit-user-select: none; padding: 5px 10px; font-size: 12px; line-height: 18px; color: #FFFFFF; border-color:#a24689; text-decoration: none; display: inline-block; margin-bottom: 0px; font-weight: 400; text-align: center; vertical-align: middle; cursor: pointer; white-space: nowrap; background-image: none; background-color: #a24689; border: 1px solid #a24689; border-radius:3px" class="o_default_snippet_text">${ctx['button_access']['title']}</a>
% endif
% if ctx.get('button_follow'):
<a href="${ctx['button_follow']['url']}" style="-webkit-user-select: none; padding: 5px 10px; font-size: 12px; line-height: 18px; color: #FFFFFF; border-color:#a24689; text-decoration: none; display: inline-block; margin-bottom: 0px; font-weight: 400; text-align: center; vertical-align: middle; cursor: pointer; white-space: nowrap; background-image: none; background-color: #a24689; border: 1px solid #a24689; border-radius:3px" class="o_default_snippet_text">${ctx['button_follow']['title']}</a>
% elif ctx.get('button_unfollow'):
<a href="${ctx['button_unfollow']['url']}" style="-webkit-user-select: none; padding: 5px 10px; font-size: 12px; line-height: 18px; color: #FFFFFF; border-color:#a24689; text-decoration: none; display: inline-block; margin-bottom: 0px; font-weight: 400; text-align: center; vertical-align: middle; cursor: pointer; white-space: nowrap; background-image: none; background-color: #a24689; border: 1px solid #a24689; border-radius:3px" class="o_default_snippet_text">${ctx['button_unfollow']['title']}</a>
% endif
% if not ctx.get('button_access') and not ctx.get('button_follow') and not ctx.get('button_unfollow') and ctx.get('model_name'):
<p style="padding: 5px 10px; font-size: 12px;">
About <strong>${ctx['model_name']}
% if ctx.get('record_name'):
: ${ctx['record_name']}
% endif
</strong>
</p>
% endif
</td>
<td valign="center" align="right" width="270" style="padding:5px 15px 5px 10px; font-size: 12px;">
<p>
% if ctx.get('actions'):
% for action in ctx['actions']:
<a href="${action['url']}" style="text-decoration:none; color: #a24689;"><strong>${action['title']}</strong></a>
%if cmp(len(ctx['actions']), 1) == 1 and cmp(len(ctx['actions']), loop.index) == 1:
|
% endif
% endfor
% else:
<strong>Sent by</strong>
% if ctx.get('website_url'):
<a href="${ctx['website_url']}" style="text-decoration:none; color: #a24689;">
% endif
<strong>${ctx.get('company_name')}</strong>
% if ctx.get('website_url'):
</a>
% endif
<strong>using</strong>
<a href="www.odoo.com" style="text-decoration:none; color: #a24689;"><strong>Odoo</strong></a>
% endif
</p>
</td>
</tr>
</tbody></table>
</div>
<div style="padding:0px; width:600px; margin:0 auto; background: #FFFFFF repeat top /100%; color:#777777">
<table cellspacing="0" cellpadding="0" style="vertical-align:top; padding:0px; border-collapse:collapse; background:inherit; color:inherit">
<tbody><tr>
<td valign="top" style="width:600px; padding:5px 10px 5px 5px;">
<div>
<hr width="100%" style="background-color:rgb(204,204,204);border:medium none;clear:both;display:block;font-size:0px;min-height:1px;line-height:0;margin:15px auto;padding:0">
</div>
</td>
</tr></tbody>
</table>
</div>
<div style="padding:0px; width:600px; margin:0 auto; background: #FFFFFF repeat top /100%;color:#777777">
<table cellspacing="0" cellpadding="0" border="0" style="margin: 0 auto; width:600px; border-collapse:collapse; background:inherit; color:inherit">
<tbody><tr>
<td style="padding:5px 10px 5px 5px;font-size: 14px;">
${object.body | safe}
% if ctx.get('tracking'):
<ul>
% for tracking in ctx['tracking']
<li>${tracking[0]} : ${tracking[1]} -&gt; ${tracking[2]}</li>
% endfor
</ul>
% endif
</td>
</tr></tbody>
</table>
</div>
% if ctx.get('signature'):
<div style="padding:0px; width:600px;margin:0 auto; background: #FFFFFF repeat top /100%;color:#777777">
<table cellspacing="0" cellpadding="0" border="0" style="margin: 0 auto; width:600px; border-collapse:collapse; background:inherit; color:inherit">
<tbody><tr>
<td style="padding:5px 10px 5px 5px;font-size: 14px; text-align: left;">
${ctx['signature'] | safe}
</td>
</tr></tbody>
</table>
</div>
% endif
]]></field>
</record>
</data>
</openerp>