This commit introduces a new notification template. Its target is to be used when sending payment-based templates like 'Send by email' for sale orders, invoices or purchase orders. Purpose is to separate the template content (payment information) from the payment button (Pay and sign online) when sending those documents by email. Composer and chatter should not hold the button. It should be added only in notifications emails. Technical solution is to have a somewhat-generic template available in mail to be used in some specific actions. Another solution is to hide the button but it breaks if people edit or remove the hidden content when editing the mail in the composer without knowing it. As the button is mandatory in those actions we choose to have it added by the notification email. Future commits will gradually use this template in some addons. This commit is linked to task ID 1860049 and PR #25824.
356 lines
18 KiB
XML
356 lines
18 KiB
XML
<?xml version="1.0" encoding="utf-8"?>
|
|
<odoo>
|
|
<data noupdate="1">
|
|
<!-- Admin should not receive emails at creation -->
|
|
<record id="base.user_root" model="res.users">
|
|
<field name="notification_type">inbox</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>
|
|
|
|
<!-- Bounce Email Alias -->
|
|
<record id="icp_mail_bounce_alias" model="ir.config_parameter">
|
|
<field name="key">mail.bounce.alias</field>
|
|
<field name="value">bounce</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>
|
|
<record id="mt_activities" model="mail.message.subtype">
|
|
<field name="name">Activities</field>
|
|
<field name="default" eval="False"/>
|
|
<field name="internal" eval="True"/>
|
|
<field name="sequence" eval="90"/>
|
|
</record>
|
|
|
|
</data>
|
|
<data>
|
|
<template id="message_notification_email">
|
|
<div>
|
|
<div t-if="has_button_access" itemscope="itemscope" itemtype="http://schema.org/EmailMessage">
|
|
<div itemprop="potentialAction" itemscope="itemscope" itemtype="http://schema.org/ViewAction">
|
|
<link itemprop="target" t-att-href="button_access['url']"/>
|
|
<link itemprop="url" t-att-href="button_access['url']"/>
|
|
<meta itemprop="name" t-att-content="button_access['title']"/>
|
|
</div>
|
|
</div>
|
|
<div t-if="has_button_access or len(actions) > 0 or not is_discussion"
|
|
summary="o_mail_notification" style="padding: 0px; width:600px;">
|
|
<table cellspacing="0" cellpadding="0" border="0" style="width: 600px; margin-top: 5px;">
|
|
<tbody><tr>
|
|
<td valign="center">
|
|
<a t-if="has_button_access"
|
|
t-att-href="button_access['url']"
|
|
style="padding: 8px 12px; font-size: 12px; color: #FFFFFF; text-decoration: none !important; font-weight: 400; background-color: #875A7B; border: 0px solid #875A7B; border-radius:3px">
|
|
<t t-esc="button_access['title']"/>
|
|
</a>
|
|
<t t-if="actions">
|
|
<t t-foreach="actions" t-as="action">
|
|
|
|
|
<a t-att-href="action['url']" style="color: #875A7B; text-decoration:none !important;">
|
|
<t t-esc="action['title']"/>
|
|
</a>
|
|
</t>
|
|
</t>
|
|
</td>
|
|
<td valign="center" align="right">
|
|
<img t-att-src="'/logo.png?company=%s' % company.id" style="padding: 0px; margin: 0px; height: auto; max-width: 80px; max-height: 40px;" t-att-alt="'%s' % company.name"/>
|
|
</td>
|
|
</tr><tr>
|
|
<td colspan="2" style="text-align:center;">
|
|
<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:10px 0;"/>
|
|
<p t-if="subtype.internal" style="background-color: #f2dede; padding: 5px; margin-bottom: 16px;">
|
|
<strong>Internal communication</strong>: Replying will post an internal note. Followers won't receive any email notification.
|
|
</p>
|
|
</td>
|
|
</tr></tbody>
|
|
</table>
|
|
</div>
|
|
<div t-raw="message.body"/>
|
|
<ul t-if="tracking_values">
|
|
<t t-foreach="tracking_values" t-as="tracking">
|
|
<li><t t-esc="tracking[0]"/>: <t t-esc="tracking[1]"/> -> <t t-esc="tracking[2]"/></li>
|
|
</t>
|
|
</ul>
|
|
<div t-if="signature" t-raw="signature"/>
|
|
<p style="color: #555555;">
|
|
Sent by
|
|
<a t-if="website_url" t-att-href="website_url" style="text-decoration:none; color: #875A7B;">
|
|
<span t-esc="company.name"/>
|
|
</a>
|
|
<span t-if="not website_url" t-esc="company.name"/>
|
|
using
|
|
<a target="_blank" href="https://www.odoo.com" style="text-decoration:none; color: #875A7B;">Odoo</a>.
|
|
</p>
|
|
</div>
|
|
</template>
|
|
|
|
<template id="mail_notification_borders">
|
|
<div>
|
|
<table border="0" width="100%" cellpadding="0" bgcolor="#ededed" style="padding: 20px; background-color: #ededed; border-collapse:separate;" summary="o_mail_notification">
|
|
<tbody>
|
|
<!-- HEADER -->
|
|
<tr>
|
|
<td align="center" style="min-width: 590px;">
|
|
<table width="590" border="0" cellpadding="0" bgcolor="#875A7B" style="min-width: 590px; background-color: rgb(135,90,123); padding: 20px; border-collapse:separate;">
|
|
<tr><td valign="middle">
|
|
<span style="font-size:20px; color:white; font-weight: bold;">
|
|
<t t-esc="message.record_name"/>
|
|
</span>
|
|
</td><td valign="middle" align="right">
|
|
<img t-att-src="'/logo.png?company=%s' % company.id" style="padding: 0px; margin: 0px; height: auto; width: 80px;" t-att-alt="'%s' % company.name"/>
|
|
</td></tr>
|
|
</table>
|
|
</td>
|
|
</tr>
|
|
<!-- CONTENT -->
|
|
<tr>
|
|
<td align="center" style="min-width: 590px;">
|
|
<table width="590" border="0" cellpadding="0" bgcolor="#ffffff" style="min-width: 590px; background-color: rgb(255, 255, 255); padding: 20px; border-collapse:separate;">
|
|
<tbody><td valign="top" style="font-family:Arial,Helvetica,sans-serif; color: #555; font-size: 14px;">
|
|
<t t-raw="message.body"/>
|
|
</td></tbody>
|
|
</table>
|
|
</td>
|
|
</tr>
|
|
<!-- FOOTER -->
|
|
<tr>
|
|
<td align="center" style="min-width: 590px;">
|
|
<table width="590" border="0" cellpadding="0" bgcolor="#875A7B" style="min-width: 590px; background-color: rgb(135,90,123); padding: 20px; border-collapse:separate;">
|
|
<tr><td valign="middle" align="left" style="color: #fff; padding-top: 10px; padding-bottom: 10px; font-size: 12px;">
|
|
<t t-esc="company.name"/><br/>
|
|
<t t-esc="company.phone"/>
|
|
</td><td valign="middle" align="right" style="color: #fff; padding-top: 10px; padding-bottom: 10px; font-size: 12px;">
|
|
<t t-if="company.email">
|
|
<a t-att-href="'mailto:%s' % company.email" style="text-decoration:none; color: white;"><t t-esc="company.email"/></a><br/>
|
|
</t>
|
|
<t t-if="company.website">
|
|
<a t-att-href="'%s' % company.website" style="text-decoration:none; color: white;">
|
|
<t t-esc="company.website"/>
|
|
</a>
|
|
</t>
|
|
</td></tr>
|
|
</table>
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td align="center">
|
|
Powered by <a target="_blank" href="https://www.odoo.com">Odoo</a>.
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
</template>
|
|
|
|
<template id="mail_notification_light">
|
|
<table border="0" cellpadding="0" cellspacing="0" style="padding-top: 16px; background-color: #F1F1F1; font-family:Verdana, Arial,sans-serif; color: #454748; width: 100%; border-collapse:separate;"><tr><td align="center">
|
|
<table border="0" cellpadding="0" cellspacing="0" width="590" style="padding: 16px; background-color: white; color: #454748; border-collapse:separate;">
|
|
<tbody>
|
|
<!-- HEADER -->
|
|
<tr>
|
|
<td align="center" style="min-width: 590px;">
|
|
<table border="0" cellpadding="0" cellspacing="0" width="590" style="min-width: 590px; background-color: white; padding: 0px 8px 0px 8px; border-collapse:separate;">
|
|
<tr><td valign="middle">
|
|
<span style="font-size: 10px;">Your <t t-esc="'%s' % model_description or 'document'"/></span><br/>
|
|
<span style="font-size: 20px; font-weight: bold;">
|
|
<t t-esc="message.record_name"/>
|
|
</span>
|
|
</td><td valign="middle" align="right">
|
|
<img t-att-src="'/logo.png?company=%s' % company.id" style="padding: 0px; margin: 0px; height: auto; width: 80px;" t-att-alt="'%s' % company.name"/>
|
|
</td></tr>
|
|
<tr><td colspan="2" style="text-align:center;">
|
|
<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:16px 0px 16px 0px;"/>
|
|
</td></tr>
|
|
</table>
|
|
</td>
|
|
</tr>
|
|
<!-- CONTENT -->
|
|
<tr>
|
|
<td align="center" style="min-width: 590px;">
|
|
<table border="0" cellpadding="0" cellspacing="0" width="590" style="min-width: 590px; background-color: white; padding: 0px 8px 0px 8px; border-collapse:separate;">
|
|
<tr><td valign="top" style="font-size: 14px;">
|
|
<t t-raw="message.body"/>
|
|
</td></tr>
|
|
<tr><td style="text-align:center;">
|
|
<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: 16px 0px 16px 0px;"/>
|
|
</td></tr>
|
|
</table>
|
|
</td>
|
|
</tr>
|
|
<!-- FOOTER -->
|
|
<tr>
|
|
<td align="center" style="min-width: 590px;">
|
|
<table border="0" cellpadding="0" cellspacing="0" width="590" style="min-width: 590px; background-color: white; font-size: 12px; padding: 0px 8px 0px 8px; border-collapse:separate;">
|
|
<tr><td valign="middle" align="left">
|
|
<t t-esc="company.name"/>
|
|
</td></tr>
|
|
<tr><td valign="middle" align="left" style="opacity: 0.7;">
|
|
<t t-esc="company.phone"/>
|
|
<t t-if="company.email"> |
|
|
<a t-att-href="'mailto:%s' % company.email" style="text-decoration:none; color: #454748;"><t t-esc="company.email"/></a>
|
|
</t>
|
|
<t t-if="company.website"> |
|
|
<a t-att-href="'%s' % company.website" style="text-decoration:none; color: #454748;">
|
|
<t t-esc="company.website"/>
|
|
</a>
|
|
</t>
|
|
</td></tr>
|
|
</table>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</td></tr>
|
|
<!-- POWERED BY -->
|
|
<tr><td align="center" style="min-width: 590px;">
|
|
<table border="0" cellpadding="0" cellspacing="0" width="590" style="min-width: 590px; background-color: #F1F1F1; color: #454748; padding: 8px; border-collapse:separate;">
|
|
<tr><td style="text-align: center; font-size: 14px;">
|
|
Powered by <a target="_blank" href="https://www.odoo.com" style="color: #875A7B;">Odoo</a>
|
|
</td></tr>
|
|
</table>
|
|
</td></tr>
|
|
</table>
|
|
</template>
|
|
|
|
<!-- Information on model to use this notification template
|
|
* if the record has an online access defined in get_access_action, having
|
|
a get_mail_url methods is required (like sale order and invoice);
|
|
* this template works best with portal-enable models although it is not
|
|
a complete requirement currently;
|
|
-->
|
|
<template id="mail_notification_paynow" name="blableblu">
|
|
<table border="0" cellpadding="0" cellspacing="0" style="padding-top: 16px; background-color: #F1F1F1; font-family:Verdana, Arial,sans-serif; color: #454748; width: 100%; border-collapse:separate;"><tr><td align="center">
|
|
<table border="0" cellpadding="0" cellspacing="0" width="590" style="padding: 16px; background-color: white; color: #454748; border-collapse:separate;">
|
|
<tbody>
|
|
<!-- HEADER -->
|
|
<tr>
|
|
<td align="center" style="min-width: 590px;">
|
|
<t t-set="access_action" t-value="record.with_context(force_website=True).get_access_action()"/>
|
|
<t t-set="is_online" t-value="access_action and access_action['type'] == 'ir.actions.act_url'"/>
|
|
<t t-set="access_url" t-value="is_online and record.get_mail_url() or ''"/>
|
|
<t t-set="access_code" t-value="'view'"/>
|
|
<t t-set="access_name" t-value="'View %s' % (record._description.lower())"/>
|
|
<table border="0" cellpadding="0" cellspacing="0" width="590" style="min-width: 590px; background-color: white; padding: 0px 8px 0px 8px; border-collapse:separate;">
|
|
<tr><td valign="middle">
|
|
<span style="font-size: 10px;">Your <t t-esc="'%s' % model_description or 'document'"/></span><br/>
|
|
<span style="font-size: 20px; font-weight: bold;">
|
|
<t t-esc="message.record_name"/>
|
|
</span>
|
|
</td><td valign="middle" align="right">
|
|
<img t-att-src="'/logo.png?company=%s' % company.id" style="padding: 0px; margin: 0px; height: auto; width: 80px;" t-att-alt="'%s' % company.name"/>
|
|
</td></tr>
|
|
<tr><td colspan="2" style="text-align:center;">
|
|
<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:16px 0px 16px 0px;"/>
|
|
</td></tr>
|
|
</table>
|
|
</td>
|
|
</tr>
|
|
<!-- CONTENT -->
|
|
<tr>
|
|
<td align="center" style="min-width: 590px;">
|
|
<table border="0" cellpadding="0" cellspacing="0" width="590" style="min-width: 590px; background-color: white; padding: 0px 8px 0px 8px; border-collapse:separate;">
|
|
<tr><td valign="top" style="font-size: 13px;">
|
|
<t t-raw="message.body"/>
|
|
<div t-if="is_online and not record._context.get('proforma')" style="margin: 16px 0px 16px 0px;">
|
|
<a t-att-href="access_url"
|
|
style="background-color: #875A7B; padding: 8px 16px 8px 16px; text-decoration: none; color: #fff; border-radius: 5px; font-size:13px;">
|
|
<t t-esc="access_name"/>
|
|
</a>
|
|
</div>
|
|
<div style="margin: 0px; padding: 0px;">
|
|
Best regards,
|
|
</div>
|
|
<div t-if="record.user_id and record.user_id.signature">
|
|
<div t-raw="record.user_id.signature"/>
|
|
</div>
|
|
</td></tr>
|
|
<tr><td style="text-align:center;">
|
|
<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: 16px 0px 16px 0px;"/>
|
|
</td></tr>
|
|
</table>
|
|
</td>
|
|
</tr>
|
|
<!-- FOOTER -->
|
|
<tr>
|
|
<td align="center" style="min-width: 590px;">
|
|
<table border="0" cellpadding="0" cellspacing="0" width="590" style="min-width: 590px; background-color: white; font-size: 11px; padding: 0px 8px 0px 8px; border-collapse:separate;">
|
|
<tr><td valign="middle" align="left">
|
|
<t t-esc="company.name"/>
|
|
</td></tr>
|
|
<tr><td valign="middle" align="left" style="opacity: 0.7;">
|
|
<t t-esc="company.phone"/>
|
|
<t t-if="company.email"> |
|
|
<a t-att-href="'mailto:%s' % company.email" style="text-decoration:none; color: #454748;"><t t-esc="company.email"/></a>
|
|
</t>
|
|
<t t-if="company.website"> |
|
|
<a t-att-href="'%s' % company.website" style="text-decoration:none; color: #454748;">
|
|
<t t-esc="company.website"/>
|
|
</a>
|
|
</t>
|
|
</td></tr>
|
|
</table>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</td></tr>
|
|
<!-- POWERED BY -->
|
|
<tr><td align="center" style="min-width: 590px;">
|
|
<table border="0" cellpadding="0" cellspacing="0" width="590" style="min-width: 590px; background-color: #F1F1F1; color: #454748; padding: 8px; border-collapse:separate;">
|
|
<tr><td style="text-align: center; font-size: 13px;">
|
|
Powered by <a target="_blank" href="https://www.odoo.com" style="color: #875A7B;">Odoo</a>
|
|
</td></tr>
|
|
</table>
|
|
</td></tr>
|
|
</table>
|
|
</template>
|
|
|
|
<!-- Channel and moderation related data -->
|
|
<template id="mail_channel_notify_moderation">
|
|
<div>
|
|
<p>Hello <t t-esc='record.name'/></p>
|
|
<p>You have messages to moderate, please go for the proceedings.</p><br/><br/>
|
|
<div style="text-align: center;">
|
|
<a href="/web#action=mail.mail_channel_action_client_chat&active_id=mailbox_moderation" style="background-color: #1abc9c; padding: 20px; text-decoration: none; color: #fff; border-radius: 5px; font-size: 16px;" class="o_default_snippet_text">Moderate Messages</a>
|
|
<br/><br/><br/>
|
|
</div>
|
|
<p>Thank you!</p>
|
|
</div>
|
|
</template>
|
|
|
|
<record id="mail_template_channel_send_guidelines" model="mail.template">
|
|
<field name="name">Partner: Send channel guidelines</field>
|
|
<field name="model_id" ref="base.model_res_partner"/>
|
|
<field name="email_from">${object.company_id.catchall or object.company_id.email|safe}</field>
|
|
<field name="partner_to">${object.id}</field>
|
|
<field name="subject">Guidelines of channel ${ctx['channel'].name}</field>
|
|
<field name="body_html" type="xml">
|
|
<div>
|
|
<p>Hello ${object.name or ''},</p>
|
|
<p>Please find below the guidelines of the ${ctx['channel'].name} channel.</p>
|
|
<p>
|
|
${ctx['channel'].moderation_guidelines_msg}
|
|
</p>
|
|
<p></p>
|
|
</div>
|
|
</field>
|
|
<field name="user_signature" eval="False"/>
|
|
</record>
|
|
</data>
|
|
</odoo>
|