4 <!-- EDI related Email Templates menu -->
5 <record model="ir.actions.act_window" id="action_email_templates">
6 <field name="name">Email Templates</field>
7 <field name="res_model">email.template</field>
8 <field name="view_type">form</field>
9 <field name="view_mode">form,tree</field>
10 <field name="view_id" ref="email_template.email_template_tree" />
11 <field name="search_view_id" ref="email_template.view_email_template_search"/>
12 <field name="context">{'search_default_model_id':'account.invoice'}</field>
13 <field name="context" eval="{'search_default_model_id': ref('account.model_account_invoice')}"/>
15 <menuitem id="menu_email_templates" parent="menu_configuration_misc" action="action_email_templates" sequence="30" groups="base.group_no_one"/>
19 <!-- Mail template are declared in a NOUPDATE block
20 so users can freely customize/delete them -->
22 <!--Email template -->
23 <record id="email_template_edi_invoice" model="email.template">
24 <field name="name">Invoice - Send by Email</field>
25 <field name="email_from">${object.user_id.email or object.company_id.email or 'noreply@localhost'}</field>
26 <field name="subject">${object.company_id.name} Invoice (Ref ${object.number or 'n/a'})</field>
27 <field name="partner_to">${object.partner_id.id}</field>
28 <field name="model_id" ref="account.model_account_invoice"/>
29 <field name="auto_delete" eval="True"/>
30 <field name="report_template" ref="account_invoices"/>
31 <field name="report_name">Invoice_${(object.number or '').replace('/','_')}_${object.state == 'draft' and 'draft' or ''}</field>
32 <field name="lang">${object.partner_id.lang}</field>
33 <field name="body_html"><![CDATA[
34 <div style="font-family: 'Lucica Grande', Ubuntu, Arial, Verdana, sans-serif; font-size: 12px; color: rgb(34, 34, 34); background-color: #FFF; ">
36 <p>Hello ${object.partner_id.name},</p>
38 <p>A new invoice is available for you: </p>
40 <p style="border-left: 1px solid #8e0000; margin-left: 30px;">
41 <strong>REFERENCES</strong><br />
42 Invoice number: <strong>${object.number}</strong><br />
43 Invoice total: <strong>${object.amount_total} ${object.currency_id.name}</strong><br />
44 Invoice date: ${object.date_invoice}<br />
46 Order reference: ${object.origin}<br />
49 Your contact: <a href="mailto:${object.user_id.email or ''}?subject=Invoice%20${object.number}">${object.user_id.name}</a>
53 % if object.paypal_url:
55 <p>It is also possible to directly pay with Paypal:</p>
56 <a style="margin-left: 120px;" href="${object.paypal_url}">
57 <img class="oe_edi_paypal_button" src="https://www.paypal.com/en_US/i/btn/btn_paynowCC_LG.gif"/>
62 <p>If you have any question, do not hesitate to contact us.</p>
63 <p>Thank you for choosing ${object.company_id.name or 'us'}!</p>
66 <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;">
67 <h3 style="margin: 0px; padding: 2px 14px; font-size: 12px; color: #DDD;">
68 <strong style="text-transform:uppercase;">${object.company_id.name}</strong></h3>
70 <div style="width: 347px; margin: 0px; padding: 5px 14px; line-height: 16px; background-color: #F2F2F2;">
71 <span style="color: #222; margin-bottom: 5px; display: block; ">
72 % if object.company_id.street:
73 ${object.company_id.street}<br/>
75 % if object.company_id.street2:
76 ${object.company_id.street2}<br/>
78 % if object.company_id.city or object.company_id.zip:
79 ${object.company_id.zip} ${object.company_id.city}<br/>
81 % if object.company_id.country_id:
82 ${object.company_id.state_id and ('%s, ' % object.company_id.state_id.name) or ''} ${object.company_id.country_id.name or ''}<br/>
85 % if object.company_id.phone:
86 <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; ">
87 Phone: ${object.company_id.phone}
90 % if object.company_id.website:
92 Web : <a href="${object.company_id.website}">${object.company_id.website}</a>