2011-06-30 13:37:57 +00:00
<?xml version="1.0" ?>
<openerp >
2011-09-30 21:21:54 +00:00
<data >
<!-- EDI Export + Send email Action -->
<record id= "ir_actions_server_edi_invoice" model= "ir.actions.server" >
2011-11-09 17:38:17 +00:00
<field name= "code" > if (object.type in ('out_invoice', 'out_refund')) and not object.partner_id.opt_out: object.edi_export_and_email(template_ext_id='account.email_template_edi_invoice', context=context)</field>
2011-09-30 21:21:54 +00:00
<field eval= "6" name= "sequence" />
<field name= "state" > code</field>
<field name= "type" > ir.actions.server</field>
<field name= "model_id" ref= "account.model_account_invoice" />
<field name= "condition" > True</field>
2011-10-06 11:36:51 +00:00
<field name= "name" > Auto-email confirmed invoices</field>
2011-09-30 21:21:54 +00:00
</record>
2011-11-05 01:59:22 +00:00
<!-- 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" > {'search_default_model_id':'account.invoice'}</field>
<field name= "context" eval= "{'search_default_model_id': ref('account.model_account_invoice')}" />
</record>
<menuitem id= "menu_email_templates" parent= "menu_configuration_misc" action= "action_email_templates" sequence= "30" />
2011-09-30 21:21:54 +00:00
</data>
2011-06-30 13:37:57 +00:00
2011-09-30 21:21:54 +00:00
<!-- Mail template and workflow bindings are done in a NOUPDATE block
so users can freely customize/delete them -->
<data noupdate= "1" >
<!-- bind the mailing server action to invoice open activity -->
<record id= "account.act_open" model= "workflow.activity" >
<field name= "action_id" ref= "ir_actions_server_edi_invoice" />
</record>
2011-06-30 13:37:57 +00:00
2011-09-30 21:21:54 +00:00
<!-- Email template -->
<record id= "email_template_edi_invoice" model= "email.template" >
<field name= "name" > Automated Invoice Notification Mail</field>
<field name= "email_from" > ${object.user_id.user_email or object.company_id.email or 'noreply@localhost'}</field>
<field name= "subject" > ${object.company_id.name} Invoice (Ref ${object.number or 'n/a' })</field>
<field name= "email_to" > ${object.address_invoice_id.email or ''}</field>
<field name= "model_id" ref= "account.model_account_invoice" />
2011-11-03 01:10:34 +00:00
<field name= "auto_delete" eval= "True" />
2011-10-05 00:34:09 +00:00
<field name= "body_html" > < ![CDATA[
2012-04-30 13:21:03 +00:00
<div style= "font-family: 'Lucica Grande', Ubuntu, Arial, Verdana, sans-serif; font-size: 12px; color: rgb(34, 34, 34); background-color: #FFF; " >
2011-08-26 11:09:14 +00:00
2011-10-05 00:34:09 +00:00
<p > Hello${object.address_invoice_id.name and ' ' or ''}${object.address_invoice_id.name or ''},</p>
2011-09-30 21:21:54 +00:00
2011-10-05 00:34:09 +00:00
<p > A new invoice is available for ${object.partner_id.name}: </p>
2011-09-30 21:21:54 +00:00
2011-10-05 00:34:09 +00:00
<p style= "border-left: 1px solid #8e0000; margin-left: 30px;" >
<strong > REFERENCES</strong> <br />
Invoice number: <strong > ${object.number}</strong> <br />
2011-10-06 11:36:51 +00:00
Invoice total: <strong > ${object.amount_total} ${object.currency_id.name}</strong> <br />
Invoice date: ${object.date_invoice}<br />
% if object.origin:
Order reference: ${object.origin}<br />
% endif
2011-10-05 00:34:09 +00:00
Your contact: <a href= "mailto:${object.user_id.user_email or ''}?subject=Invoice%20${object.number}" > ${object.user_id.name}</a>
</p>
2011-09-30 21:21:54 +00:00
2011-10-05 00:34:09 +00:00
<p >
2011-09-30 21:21:54 +00:00
You can view the invoice document, download it and pay online using the following link:
2011-10-05 00:34:09 +00:00
</p>
2012-04-30 13:21:03 +00:00
<a style= "display:block; width: 150px; height:20px; margin-left: 120px; color: #DDD; 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;"
2011-10-06 11:36:51 +00:00
href="${ctx.get('edi_web_url_view') or ''}">View Invoice</a>
2011-09-30 21:21:54 +00:00
2011-11-07 18:50:11 +00:00
% if object.company_id.paypal_account and object.type in ('out_invoice', 'in_refund'):
2011-10-10 10:39:04 +00:00
< %
comp_name = quote(object.company_id.name)
inv_number = quote(object.number)
paypal_account = quote(object.company_id.paypal_account)
inv_amount = quote(str(object.amount_total))
cur_name = quote(object.currency_id.name)
paypal_url = "https://www.paypal.com/cgi-bin/webscr?cmd=_xclick& business=%s& item_name=%s%%20Invoice%%20%s& " \
"invoice=%s& amount=%s& currency_code=%s& button_subtype=services& no_note=1& bn=OpenERP_Invoice_PayNow_%s" % \
(paypal_account,comp_name,inv_number,inv_number,inv_amount,cur_name,cur_name)
%>
2011-10-05 00:34:09 +00:00
<br />
<p > It is also possible to directly pay with Paypal:</p>
2011-10-28 13:49:32 +00:00
<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>
2011-09-30 21:21:54 +00:00
% endif
2011-10-05 00:34:09 +00:00
<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 />
2011-10-26 00:01:10 +00:00
<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;" >
2012-04-30 13:21:03 +00:00
<h3 style= "margin: 0px; padding: 2px 14px; font-size: 12px; color: #DDD;" >
2011-10-05 00:34:09 +00:00
<strong style= "text-transform:uppercase;" > ${object.company_id.name}</strong> </h3>
</div>
2011-10-26 00:01:10 +00:00
<div style= "width: 347px; margin: 0px; padding: 5px 14px; line-height: 16px; background-color: #F2F2F2;" >
<span style= "color: #222; margin-bottom: 5px; display: block; " >
2011-09-30 21:21:54 +00:00
% if object.company_id.street:
2011-10-05 00:34:09 +00:00
${object.company_id.street}<br />
2011-09-30 21:21:54 +00:00
% endif
% if object.company_id.street2:
2011-10-05 00:34:09 +00:00
${object.company_id.street2}<br />
2011-09-30 21:21:54 +00:00
% endif
% if object.company_id.city or object.company_id.zip:
2011-10-05 00:34:09 +00:00
${object.company_id.zip} ${object.company_id.city}<br />
2011-09-30 21:21:54 +00:00
% endif
% if object.company_id.country_id:
2011-10-05 00:34:09 +00:00
${object.company_id.state_id and ('%s, ' % object.company_id.state_id.name) or ''} ${object.company_id.country_id.name or ''}<br />
2011-09-30 21:21:54 +00:00
% endif
2011-10-05 00:34:09 +00:00
</span>
2011-09-30 21:21:54 +00:00
% if object.company_id.phone:
2011-10-05 00:34:09 +00:00
<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; " >
2011-09-30 21:21:54 +00:00
Phone: ${object.company_id.phone}
2011-10-05 00:34:09 +00:00
</div>
2011-09-30 21:21:54 +00:00
% endif
% if object.company_id.website:
2011-10-05 00:34:09 +00:00
<div >
Web : <a href= "${object.company_id.website}" > ${object.company_id.website}</a>
</div>
2011-09-30 21:21:54 +00:00
%endif
2011-10-05 00:34:09 +00:00
<p > </p>
</div>
</div>
]]></field>
<field name= "body_text" > < ![CDATA[
2011-09-30 21:21:54 +00:00
Hello${object.address_invoice_id.name and ' ' or ''}${object.address_invoice_id.name or ''},
2011-08-26 11:09:14 +00:00
2011-09-30 21:21:54 +00:00
A new invoice is available for ${object.partner_id.name}:
2011-10-06 11:36:51 +00:00
| Invoice number: *${object.number}*
| Invoice total: *${object.amount_total} ${object.currency_id.name}*
| Invoice date: ${object.date_invoice}
% if object.origin:
| Order reference: ${object.origin}
% endif
2011-10-10 14:36:27 +00:00
| Your contact: ${object.user_id.name} ${object.user_id.user_email and '< %s>'%(object.user_id.user_email) or ''}
2011-08-26 11:09:14 +00:00
2011-09-30 21:21:54 +00:00
You can view the invoice document, download it and pay online using the following link:
2011-10-06 11:36:51 +00:00
${ctx.get('edi_web_url_view') or 'n/a'}
2011-08-26 11:09:14 +00:00
2011-11-07 18:50:11 +00:00
% if object.company_id.paypal_account and object.type in ('out_invoice', 'in_refund'):
2011-10-10 10:39:04 +00:00
< %
comp_name = quote(object.company_id.name)
inv_number = quote(object.number)
paypal_account = quote(object.company_id.paypal_account)
inv_amount = quote(str(object.amount_total))
cur_name = quote(object.currency_id.name)
paypal_url = "https://www.paypal.com/cgi-bin/webscr?cmd=_xclick& business=%s& item_name=%s%%20Invoice%%20%s"\
"& invoice=%s& amount=%s& currency_code=%s& button_subtype=services& no_note=1& bn=OpenERP_Invoice_PayNow_%s" % \
(paypal_account,comp_name,inv_number,inv_number,inv_amount,cur_name,cur_name)
%>
2011-09-30 21:21:54 +00:00
It is also possible to directly pay with Paypal:
2011-10-10 10:39:04 +00:00
${paypal_url}
2011-09-30 21:21:54 +00:00
% endif
2011-06-30 13:37:57 +00:00
2011-09-30 21:21:54 +00:00
If you have any question, do not hesitate to contact us.
2011-07-15 07:44:42 +00:00
2011-06-30 13:37:57 +00:00
2011-09-30 21:21:54 +00:00
Thank you for choosing ${object.company_id.name}!
2011-06-30 13:37:57 +00:00
2011-09-30 21:21:54 +00:00
--
2011-10-10 14:36:27 +00:00
${object.user_id.name} ${object.user_id.user_email and '< %s>'%(object.user_id.user_email) or ''}
2011-08-26 11:09:14 +00:00
${object.company_id.name}
2011-09-30 21:21:54 +00:00
% if object.company_id.street:
${object.company_id.street or ''}
% endif
% if object.company_id.street2:
${object.company_id.street2}
% endif
% if object.company_id.city or object.company_id.zip:
${object.company_id.zip or ''} ${object.company_id.city or ''}
% 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 ''}
% endif
% if object.company_id.phone:
Phone: ${object.company_id.phone}
% endif
% if object.company_id.website:
${object.company_id.website or ''}
% endif
2011-10-05 00:34:09 +00:00
]]></field>
2011-09-30 21:21:54 +00:00
</record>
</data>
2011-06-30 13:37:57 +00:00
</openerp>