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) code ir.actions.server True Auto-email confirmed invoices Email Templates email.template form form,tree {'search_default_model_id':'account.invoice'} Automated Invoice Notification Mail ${object.user_id.email or object.company_id.email or 'noreply@localhost'} ${object.company_id.name} Invoice (Ref ${object.number or 'n/a' }) ${object.partner_id.email or ''}

Hello${object.partner_id.name and ' ' or ''}${object.partner_id.name or ''},

A new invoice is available for ${object.partner_id.name}:

  REFERENCES
  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   Your contact: ${object.user_id.name}

You can view the invoice document, download it and pay online using the following link:

View Invoice % if object.company_id.paypal_account and object.type in ('out_invoice', 'in_refund'): <% 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) %>

It is also possible to directly pay with Paypal:

% endif

If you have any question, do not hesitate to contact us.

Thank you for choosing ${object.company_id.name or 'us'}!



${object.company_id.name}

% if object.company_id.street: ${object.company_id.street}
% 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} ${object.company_id.city}
% 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: %endif

]]>