[FIX] sale: Don't display 'View quotation' button on email if no website If the website module is not installed, the button 'View Quotation' will lead to the backend chatter page, which is not very useful in our case. As the quotation is already attached in the mail as a pdf, just don't display the button if the website module is not installed [FIX] account,sale: Don't send notif template to portal customers if no website [FIX] account: Don't display 'View Invoice' button on email if no website If the website module is not installed, the button 'View Invoice' will lead to the backend chatter page, which is not very useful in our case. As the invoice is already attached in the mail as a pdf, just don't display the button if the website module is not installed [FIX] website_sale: override get_access_action to redirect to my/invoices
51 lines
2.5 KiB
XML
51 lines
2.5 KiB
XML
<?xml version="1.0" encoding="utf-8"?>
|
|
<odoo>
|
|
<data noupdate="1">
|
|
|
|
<!--Email template -->
|
|
<record id="email_template_edi_sale" model="mail.template">
|
|
<field name="name">Sales Order - Send by Email</field>
|
|
<field name="email_from">${(object.user_id.email and '%s <%s>' % (object.user_id.name, object.user_id.email) or '')|safe}</field>
|
|
<field name="subject">${object.company_id.name} ${object.state in ('draft', 'sent') and 'Quotation' or 'Order'} (Ref ${object.name or 'n/a' })</field>
|
|
<field name="partner_to">${object.partner_invoice_id.id}</field>
|
|
<field name="model_id" ref="sale.model_sale_order"/>
|
|
<field name="auto_delete" eval="True"/>
|
|
<field name="report_template" ref="report_sale_order"/>
|
|
<field name="report_name">${(object.name or '').replace('/','_')}_${object.state == 'draft' and 'draft' or ''}</field>
|
|
<field name="lang">${object.partner_id.lang}</field>
|
|
<field name="body_html"><![CDATA[
|
|
% set access_action = object.get_access_action()
|
|
% set doc_name = 'quotation' if object.state in ('draft', 'sent') else 'order confirmation'
|
|
% set is_online = access_action and access_action['type'] == 'ir.actions.act_url'
|
|
% set access_name = is_online and object.template_id and 'Accept and pay %s online' % doc_name or 'View %s' % doc_name
|
|
% set access_url = is_online and access_action['url'] or object.get_signup_url()
|
|
|
|
<p>Dear
|
|
% if object.partner_id.is_company and object.child_ids:
|
|
${object.partner_id.child_ids[0].name}
|
|
% else :
|
|
${object.partner_id.name}
|
|
% endif
|
|
,</p>
|
|
<p>Thank you for your inquiry.<br />
|
|
Here is your ${doc_name} <strong>${object.name}</strong>
|
|
% if object.origin:
|
|
(with reference: ${object.origin} )
|
|
% endif
|
|
amounting in <strong>${object.amount_total} ${object.pricelist_id.currency_id.name}</strong>
|
|
from ${object.company_id.name}.
|
|
</p>
|
|
|
|
% if is_online:
|
|
<p style="margin-left: 30px; margin-top: 10 px; margin-bottom: 10px;">
|
|
<a href="${access_url}" style="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">${access_name}</a>
|
|
</p>
|
|
% endif
|
|
<p>If you have any question, do not hesitate to contact us.</p>
|
|
<p>Best regards,</p>
|
|
]]></field>
|
|
</record>
|
|
|
|
</data>
|
|
</odoo>
|