[REF] various: use secondary notification template

All those templates are basically the same except some bug fixes that
were not propagated about company. Let us use just the one we just
defined in the mail module.
This commit is contained in:
Thibault Delavallée
2018-01-29 16:56:04 +01:00
parent 2f6a661fe9
commit 885e7fcda9
8 changed files with 4 additions and 211 deletions
@@ -61,65 +61,5 @@ from ${object.company_id.name}.
</p>
</div></field>
</record>
<!--Default Notification Email template for invoices-->
<template id="mail_notification_invoice">
<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;">
Invoice <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>
</data>
</odoo>
+1 -1
View File
@@ -634,7 +634,7 @@ class AccountInvoice(models.Model):
default_template_id=template and template.id or False,
default_composition_mode='comment',
mark_invoice_as_sent=True,
custom_layout="account.mail_notification_invoice",
custom_layout="mail.mail_notification_borders",
force_email=True
)
return {
@@ -26,50 +26,5 @@
<p>Thank you,</p>
</field>
</record>
<template id="mail_notification_delivery">
<table border="0" width="100%" cellpadding="0" bgcolor="#ededed" style="font-family:Arial,Helvetica,sans-serif; padding: 20px; background-color: #ededed" summary="o_mail_notification">
<tbody><!-- HEADER --><tr>
<td align="center" style="min-width: 590px;">
<table width="650" border="0" cellpadding="0" bgcolor="#875A7B" style="min-width: 590px; background-color: rgb(135,90,123); padding: 20px;">
<tr><td valign="middle">
<span style="font-size:20px; color:white; font-weight: bold;" t-field="message.record_name"/>
</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="650" border="0" cellpadding="0" bgcolor="#ffffff" style="min-width: 590px; background-color: rgb(255, 255, 255); padding: 20px;">
<tbody>
<td valign="top" style="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="650" border="0" cellpadding="0" bgcolor="#875A7B" style="min-width: 590px; background-color: rgb(135,90,123); padding: 20px;">
<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 href="https://www.odoo.com">Odoo</a>.</td>
</tr></tbody>
</table>
</template>
</data>
</odoo>
+1 -1
View File
@@ -148,7 +148,7 @@ class StockPicking(models.Model):
default_model='stock.picking',
default_use_template=bool(delivery_template_id),
default_template_id=delivery_template_id,
custom_layout='delivery.mail_notification_delivery'
custom_layout='mail.mail_notification_borders'
)
return {
'type': 'ir.actions.act_window',
@@ -76,56 +76,5 @@ from ${object.company_id.name}.
<p>Thank you,</p>
]]></field>
</record>
<!--Default Notification Email template for invoices-->
<template id="mail_notification_purchase">
<table border="0" width="100%" cellpadding="0" bgcolor="#ededed" style="padding: 20px; background-color: #ededed" 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;">
<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;">
<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;">
<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 href="https://www.odoo.com">Odoo</a>.
</td>
</tr></tbody>
</table>
</template>
</data>
</odoo>
+1 -1
View File
@@ -306,7 +306,7 @@ class PurchaseOrder(models.Model):
'default_use_template': bool(template_id),
'default_template_id': template_id,
'default_composition_mode': 'comment',
'custom_layout': "purchase.mail_notification_purchase",
'custom_layout': "mail.mail_notification_borders",
'force_email': True,
'mark_rfq_as_sent': True,
})
-51
View File
@@ -60,56 +60,5 @@ from ${object.company_id.name}.
</p>
]]></field>
</record>
<!--Default Notification Email template for invoices-->
<template id="mail_notification_sale_order">
<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-field="message.record_name"/>
</td><td valign="middle" align="right">
<img t-att-src="'/logo.png?company=%d' % company.id" style="padding: 0px; margin: 0px; height: auto; width: 80px;" t-att-alt="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;">
<a t-if="company.email" t-att-href="'mailto:%s' % company.email" style="text-decoration:none; color: white;"><t t-esc="company.email"/></a><br/>
<a t-if="company.website" t-att-href="company.website" style="text-decoration:none; color: white;">
<t t-esc="company.website"/>
</a>
</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>
</data>
</odoo>
+1 -1
View File
@@ -482,7 +482,7 @@ class SaleOrder(models.Model):
'default_template_id': template_id,
'default_composition_mode': 'comment',
'mark_so_as_sent': True,
'custom_layout': "sale.mail_notification_sale_order",
'custom_layout': "mail.mail_notification_borders",
'proforma': self.env.context.get('proforma', False),
'force_email': True
}