118 lines
6.1 KiB
XML
118 lines
6.1 KiB
XML
<?xml version="1.0" ?>
|
|
<openerp>
|
|
<data>
|
|
|
|
<!-- EDI related Email Templates menu -->
|
|
<record model="ir.actions.act_window" id="action_email_templates">
|
|
<field name="name">Email Templates</field>
|
|
<field name="res_model">email.template</field>
|
|
<field name="view_type">form</field>
|
|
<field name="view_mode">form,tree</field>
|
|
<field name="view_id" ref="email_template.email_template_tree" />
|
|
<field name="search_view_id" ref="email_template.view_email_template_search"/>
|
|
<field name="context" eval="{'search_default_model_id': ref('sale.model_sale_order')}"/>
|
|
</record>
|
|
<menuitem id="base.menu_sales_configuration_misc" name="Miscellaneous" parent="base.menu_base_config" sequence="75"/>
|
|
</data>
|
|
|
|
|
|
<!-- Mail template is done in a NOUPDATE block
|
|
so users can freely customize/delete them -->
|
|
<data noupdate="1">
|
|
|
|
<!--Email template -->
|
|
<record id="email_template_edi_sale" model="email.template">
|
|
<field name="name">Automated Sale Order Notification Mail</field>
|
|
<field name="email_from">${object.user_id.email or ''}</field>
|
|
<field name="subject">${object.company_id.name} Order (Ref ${object.name or 'n/a' })</field>
|
|
<field name="email_to">${object.partner_invoice_id.email}</field>
|
|
<field name="model_id" ref="sale.model_sale_order"/>
|
|
<field name="auto_delete" eval="True"/>
|
|
<field name="body_html"><![CDATA[
|
|
<div style="font-family: 'Lucica Grande', Ubuntu, Arial, Verdana, sans-serif; font-size: 12px; color: rgb(34, 34, 34); background-color: rgb(255, 255, 255); ">
|
|
|
|
<p>Hello${object.partner_id.name and ' ' or ''}${object.partner_id.name or ''},</p>
|
|
|
|
<p>Here is your ${object.state in ('draft', 'sent') and 'quotation' or 'order confirmation'} from ${object.company_id.name}: </p>
|
|
|
|
<p style="border-left: 1px solid #8e0000; margin-left: 30px;">
|
|
<strong>REFERENCES</strong><br />
|
|
Order number: <strong>${object.name}</strong><br />
|
|
Order total: <strong>${object.amount_total} ${object.pricelist_id.currency_id.name}</strong><br />
|
|
Order date: ${object.date_order}<br />
|
|
% if object.origin:
|
|
Order reference: ${object.origin}<br />
|
|
% endif
|
|
% if object.client_order_ref:
|
|
Your reference: ${object.client_order_ref}<br />
|
|
% endif
|
|
Your contact: <a href="mailto:${object.user_id.email or ''}?subject=Order%20${object.name}">${object.user_id.name}</a>
|
|
</p>
|
|
|
|
<p>
|
|
You can view the ${object.state in ('draft', 'sent') and 'quotation' or 'order confirmation'} document, download it and pay online using the following link:
|
|
</p>
|
|
<a style="display:block; width: 150px; height:20px; margin-left: 120px; color: #FFF; font-family: 'Lucida Grande', Helvetica, Arial, sans-serif; font-size: 13px; font-weight: bold; text-align: center; text-decoration: none !important; line-height: 1; padding: 5px 0px 0px 0px; background-color: #8E0000; border-radius: 5px 5px; background-repeat: repeat no-repeat;"
|
|
href="${ctx.get('edi_web_url_view') or ''}">View Order</a>
|
|
|
|
% if object.order_policy in ('prepaid','manual') and object.company_id.paypal_account and object.state not in ('draft', 'sent'):
|
|
<%
|
|
comp_name = quote(object.company_id.name)
|
|
order_name = quote(object.name)
|
|
paypal_account = quote(object.company_id.paypal_account)
|
|
order_amount = quote(str(object.amount_total))
|
|
cur_name = quote(object.pricelist_id.currency_id.name)
|
|
paypal_url = "https://www.paypal.com/cgi-bin/webscr?cmd=_xclick&business=%s&item_name=%s%%20Order%%20%s" \
|
|
"&invoice=%s&amount=%s&currency_code=%s&button_subtype=services&no_note=1" \
|
|
"&bn=OpenERP_Order_PayNow_%s" % \
|
|
(paypal_account,comp_name,order_name,order_name,order_amount,cur_name,cur_name)
|
|
%>
|
|
<br/>
|
|
<p>It is also possible to directly pay with Paypal:</p>
|
|
<a style="margin-left: 120px;" href="${paypal_url}">
|
|
<img class="oe_edi_paypal_button" src="https://www.paypal.com/en_US/i/btn/btn_paynowCC_LG.gif"/>
|
|
</a>
|
|
% endif
|
|
|
|
<br/>
|
|
<p>If you have any question, do not hesitate to contact us.</p>
|
|
<p>Thank you for choosing ${object.company_id.name or 'us'}!</p>
|
|
<br/>
|
|
<br/>
|
|
<div style="width: 375px; margin: 0px; padding: 0px; background-color: #8E0000; border-top-left-radius: 5px 5px; border-top-right-radius: 5px 5px; background-repeat: repeat no-repeat;">
|
|
<h3 style="margin: 0px; padding: 2px 14px; font-size: 12px; color: #FFF;">
|
|
<strong style="text-transform:uppercase;">${object.company_id.name}</strong></h3>
|
|
</div>
|
|
<div style="width: 347px; margin: 0px; padding: 5px 14px; line-height: 16px; background-color: #F2F2F2;">
|
|
<span style="color: #222; margin-bottom: 5px; display: block; ">
|
|
% if object.company_id.street:
|
|
${object.company_id.street}<br/>
|
|
% endif
|
|
% if object.company_id.street2:
|
|
${object.company_id.street2}<br/>
|
|
% endif
|
|
% if object.company_id.city or object.company_id.zip:
|
|
${object.company_id.zip} ${object.company_id.city}<br/>
|
|
% endif
|
|
% if object.company_id.country_id:
|
|
${object.company_id.state_id and ('%s, ' % object.company_id.state_id.name) or ''} ${object.company_id.country_id.name or ''}<br/>
|
|
% endif
|
|
</span>
|
|
% if object.company_id.phone:
|
|
<div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; ">
|
|
Phone: ${object.company_id.phone}
|
|
</div>
|
|
% endif
|
|
% if object.company_id.website:
|
|
<div>
|
|
Web : <a href="${object.company_id.website}">${object.company_id.website}</a>
|
|
</div>
|
|
%endif
|
|
<p></p>
|
|
</div>
|
|
</div>
|
|
]]></field>
|
|
</record>
|
|
</data>
|
|
</openerp>
|