[REF] purchase: clean send by email templates
Purpose * use the new notification template allowing to display the payment button only in emails; * reorder the fields definition to ease the reading; * slightly clean the email body using a maximum of div and br tags as it seems better integrated with Odoo edition capabilities; This commit is linked to task ID 1860049 and PR #25824.
This commit is contained in:
@@ -1,80 +1,74 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<odoo>
|
||||
<data noupdate="1">
|
||||
|
||||
<!--Email template -->
|
||||
<record id="email_template_edi_purchase" model="mail.template">
|
||||
<field name="name">RFQ - Send by Email</field>
|
||||
<field name="email_from">${(object.create_uid.email and '"%s" <%s>' % (object.create_uid.name, object.create_uid.email) or '')|safe}</field>
|
||||
<field name="name">Purchase Order: Send RFQ</field>
|
||||
<field name="model_id" ref="purchase.model_purchase_order"/>
|
||||
<field name="email_from">${object.create_uid.email_formatted | safe}</field>
|
||||
<field name="subject">${object.company_id.name} Order (Ref ${object.name or 'n/a' })</field>
|
||||
<field name="partner_to">${object.partner_id.id}</field>
|
||||
<field name="model_id" ref="purchase.model_purchase_order"/>
|
||||
<field name="auto_delete" eval="True"/>
|
||||
<field name="body_html" type="html">
|
||||
<div style="margin: 0px; padding: 0px;">
|
||||
<p style="margin: 0px; padding: 0px; font-size: 13px;">
|
||||
Dear ${object.partner_id.name}
|
||||
% if object.partner_id.parent_id:
|
||||
(${object.partner_id.parent_id.name})
|
||||
% endif
|
||||
<br /><br />
|
||||
Here is in attachment a ${object.state in ('draft', 'sent') and 'request for quotation' or 'purchase order'} <strong>${object.name}</strong>
|
||||
% if object.partner_ref:
|
||||
with reference: ${object.partner_ref}
|
||||
% endif
|
||||
% if object.origin:
|
||||
(RFQ origin: ${object.origin})
|
||||
% endif
|
||||
amounting in <strong>${format_amount(object.amount_total, object.currency_id)}</strong>
|
||||
from ${object.company_id.name}.
|
||||
<br /><br />
|
||||
Do not hesitate to contact us if you have any question.
|
||||
<br /><br />
|
||||
Best regards,
|
||||
</p>
|
||||
</div></field>
|
||||
<field name="report_template" ref="report_purchase_quotation"/>
|
||||
<field name="report_name">RFQ_${(object.name or '').replace('/','_')}</field>
|
||||
<field name="lang">${object.partner_id.lang}</field>
|
||||
<field name="body_html"><![CDATA[
|
||||
<p>Dear
|
||||
% if object.partner_id.is_company and object.partner_id.child_ids:
|
||||
${object.partner_id.child_ids[0].name}
|
||||
% else :
|
||||
${object.partner_id.name}
|
||||
% endif
|
||||
,</p><p>
|
||||
Here is, in attachment, a ${object.state in ('draft', 'sent') and 'request for quotation' or 'purchase order confirmation'} <strong>${object.name}</strong>
|
||||
% if object.partner_ref:
|
||||
with reference: ${object.partner_ref}
|
||||
% endif
|
||||
% if object.origin:
|
||||
(RFQ origin: ${object.origin})
|
||||
% endif
|
||||
amounting in <strong>${format_amount(object.amount_total, object.currency_id)}</strong>
|
||||
from ${object.company_id.name}.
|
||||
</p>
|
||||
|
||||
<p>Do not hesitate to contact us, further you have any question.</p>
|
||||
<p>Best regards,</p>
|
||||
<p style="color:#888888;">
|
||||
% if object.user_id and object.user_id.signature:
|
||||
${object.user_id.signature | safe}
|
||||
% endif
|
||||
</p>
|
||||
]]></field>
|
||||
<field name="user_signature" eval="False"/>
|
||||
<field name="auto_delete" eval="True"/>
|
||||
</record>
|
||||
|
||||
|
||||
<!--Email template -->
|
||||
<record id="email_template_edi_purchase_done" model="mail.template">
|
||||
<field name="name">Purchase Order - Send by Email</field>
|
||||
<field name="email_from">${(object.create_uid.email and '"%s" <%s>' % (object.create_uid.name, object.create_uid.email) or '')|safe}</field>
|
||||
<field name="name">Purchase Order: Send PO</field>
|
||||
<field name="model_id" ref="purchase.model_purchase_order"/>
|
||||
<field name="email_from">${object.create_uid.email_formatted | safe}</field>
|
||||
<field name="subject">${object.company_id.name} Order (Ref ${object.name or 'n/a' })</field>
|
||||
<field name="partner_to">${object.partner_id.id}</field>
|
||||
<field name="model_id" ref="purchase.model_purchase_order"/>
|
||||
<field name="auto_delete" eval="True"/>
|
||||
<field name="body_html" type="html">
|
||||
<div style="margin: 0px; padding: 0px;">
|
||||
<p style="margin: 0px; padding: 0px; font-size: 13px;">
|
||||
Dear ${object.partner_id.name}
|
||||
% if object.partner_id.parent_id:
|
||||
(${object.partner_id.parent_id.name})
|
||||
% endif
|
||||
<br /><br />
|
||||
Here is in attachment a ${object.state in ('draft', 'sent') and 'request for quotation' or 'purchase order'} <strong>${object.name}</strong>
|
||||
% if object.partner_ref:
|
||||
with reference: ${object.partner_ref}
|
||||
% endif
|
||||
% if object.origin:
|
||||
(RFQ origin: ${object.origin})
|
||||
% endif
|
||||
amounting in <strong>${format_amount(object.amount_total, object.currency_id)}</strong>
|
||||
from ${object.company_id.name}.
|
||||
<br /><br />
|
||||
Do not hesitate to contact us if you have any question.
|
||||
</p>
|
||||
</div></field>
|
||||
<field name="report_template" ref="action_report_purchase_order"/>
|
||||
<field name="report_name">PO_${(object.name or '').replace('/','_')}</field>
|
||||
<field name="lang">${object.partner_id.lang}</field>
|
||||
<field name="body_html"><![CDATA[
|
||||
<p>Dear ${object.partner_id.name}
|
||||
% if object.partner_id.parent_id:
|
||||
(<i>${object.partner_id.parent_id.name}</i>)
|
||||
% endif
|
||||
,</p>
|
||||
<p>
|
||||
Please find in attachment a <strong>${object.state in ('draft', 'sent') and 'request for quotation' or 'purchase order confirmation'} ${object.name}</strong>
|
||||
% if object.partner_ref:
|
||||
with reference: ${object.partner_ref}
|
||||
% endif
|
||||
% if object.origin:
|
||||
(RFQ origin: ${object.origin})
|
||||
% endif
|
||||
amounting <strong>${format_amount(object.amount_total, object.currency_id)}</strong>
|
||||
from ${object.company_id.name}.
|
||||
</p>
|
||||
|
||||
<p>You can reply to this email if you have any questions.</p>
|
||||
<p>Thank you,</p>
|
||||
]]></field>
|
||||
<field name="user_signature" eval="False"/>
|
||||
<field name="auto_delete" eval="True"/>
|
||||
</record>
|
||||
</data>
|
||||
</odoo>
|
||||
|
||||
@@ -262,7 +262,7 @@ class PurchaseOrder(models.Model):
|
||||
'default_use_template': bool(template_id),
|
||||
'default_template_id': template_id,
|
||||
'default_composition_mode': 'comment',
|
||||
'custom_layout': "mail.mail_notification_borders",
|
||||
'custom_layout': "mail.mail_notification_paynow",
|
||||
'force_email': True,
|
||||
'mark_rfq_as_sent': True,
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user