115 lines
5.2 KiB
XML
115 lines
5.2 KiB
XML
<?xml version="1.0" encoding="utf-8"?>
|
|
<odoo>
|
|
<data noupdate="1">
|
|
<!-- Activities -->
|
|
<record id="mail_act_sale_upsell" model="mail.activity.type">
|
|
<field name="name">Order Upsell</field>
|
|
<field name="icon">fa-line-chart</field>
|
|
<field name="res_model_id" ref="sale.model_sale_order"/>
|
|
</record>
|
|
|
|
<!-- Sale-related subtypes for messaging / Chatter -->
|
|
<record id="mt_order_sent" model="mail.message.subtype">
|
|
<field name="name">Quotation sent</field>
|
|
<field name="res_model">sale.order</field>
|
|
<field name="default" eval="False"/>
|
|
<field name="description">Quotation sent</field>
|
|
</record>
|
|
<record id="mt_order_confirmed" model="mail.message.subtype">
|
|
<field name="name">Sales Order Confirmed</field>
|
|
<field name="res_model">sale.order</field>
|
|
<field name="default" eval="False"/>
|
|
<field name="description">Quotation confirmed</field>
|
|
</record>
|
|
|
|
<!-- Salesteam-related subtypes for messaging / Chatter -->
|
|
<record id="mt_salesteam_order_sent" model="mail.message.subtype">
|
|
<field name="name">Quotation sent</field>
|
|
<field name="sequence">20</field>
|
|
<field name="res_model">crm.team</field>
|
|
<field name="parent_id" eval="ref('sale.mt_order_sent')"/>
|
|
<field name="relation_field">team_id</field>
|
|
</record>
|
|
<record id="mt_salesteam_order_confirmed" model="mail.message.subtype">
|
|
<field name="name">Sales Order Confirmed</field>
|
|
<field name="sequence">21</field>
|
|
<field name="res_model">crm.team</field>
|
|
<field name="parent_id" eval="ref('sale.mt_order_confirmed')"/>
|
|
<field name="relation_field">team_id</field>
|
|
</record>
|
|
<record id="mt_salesteam_invoice_created" model="mail.message.subtype">
|
|
<field name="name">Invoice Created</field>
|
|
<field name="sequence">22</field>
|
|
<field name="res_model">crm.team</field>
|
|
<field name="parent_id" eval="ref('account.mt_invoice_created')"/>
|
|
<field name="relation_field">team_id</field>
|
|
</record>
|
|
<record id="mt_salesteam_invoice_confirmed" model="mail.message.subtype">
|
|
<field name="name">Invoice Confirmed</field>
|
|
<field name="sequence">23</field>
|
|
<field name="res_model">crm.team</field>
|
|
<field name="parent_id" eval="ref('account.mt_invoice_validated')"/>
|
|
<field name="relation_field">team_id</field>
|
|
</record>
|
|
|
|
<!--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_id.id}</field>
|
|
<field name="model_id" ref="sale.model_sale_order"/>
|
|
<field name="auto_delete" eval="True"/>
|
|
<field name="report_template" ref="action_report_saleorder"/>
|
|
<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[
|
|
<p>Dear ${object.partner_id.name}
|
|
% set access_action = object.with_context(force_website=True).get_access_action()
|
|
% set is_online = access_action and access_action['type'] == 'ir.actions.act_url'
|
|
% set doc_name = 'quotation' if object.state in ('draft', 'sent') else 'order confirmation'
|
|
% set pay_sign_name = object.get_portal_confirmation_action()
|
|
% set access_name = is_online and object.state in ('draft', 'sent') and pay_sign_name == 'pay' and 'Accept and pay online' or pay_sign_name == 'sign' and 'Accept and sign online' or 'View %s' % doc_name
|
|
% set access_url = is_online and object.get_mail_url() or ''
|
|
|
|
% if object.partner_id.parent_id:
|
|
(<i>${object.partner_id.parent_id.name}</i>)
|
|
% endif
|
|
,</p>
|
|
<p>
|
|
Here is
|
|
% if ctx.get('proforma')
|
|
in attachment, your pro-forma invoice
|
|
% else
|
|
the ${doc_name} <strong>${object.name}</strong>
|
|
% endif
|
|
% if object.origin:
|
|
(with reference: ${object.origin} )
|
|
% endif
|
|
amounting in <strong>${format_amount(object.amount_total, object.pricelist_id.currency_id)}</strong>
|
|
from ${object.company_id.name}.
|
|
</p>
|
|
|
|
% if is_online and not ctx.get('proforma'):
|
|
<br/><br/>
|
|
<center>
|
|
<a href="${access_url}" style="background-color: #1abc9c; padding: 20px; text-decoration: none; color: #fff; border-radius: 5px; font-size: 16px;" class="o_default_snippet_text">${access_name}</a>
|
|
<br/><br/><br/>
|
|
<span style="color:#888888">(or view attached PDF)</span>
|
|
</center>
|
|
<br/>
|
|
% endif
|
|
|
|
<p>You can reply to this email if you have any questions.</p>
|
|
<p>Thank you,</p>
|
|
|
|
<p style="color:#888888;">
|
|
% if object.user_id and object.user_id.signature:
|
|
${object.user_id.signature | safe}
|
|
% endif
|
|
</p>
|
|
]]></field>
|
|
</record>
|
|
</data>
|
|
</odoo>
|