2011-06-30 13:37:57 +00:00
<?xml version="1.0" ?>
<openerp >
<data >
<!-- Export edi document -->
2011-07-15 07:44:42 +00:00
<record id= "ir_actions_server_edi_invoice" model= "ir.actions.server" >
2011-08-26 12:25:19 +00:00
<field name= "code" > context.update({'edi_web_invoice_url_view': '%s/edi/view_edi?db=%s& token=%s' %(self.pool.get('ir.config_parameter').get_param(cr, uid, 'web.base.url'),cr.dbname, self.pool.get('ir.edi.document').export_edi(cr, uid, [object], context = context)[0])})
2011-08-24 13:06:53 +00:00
if not object.partner_id.opt_out: self.pool.get('email.template').generate_mail(cr,
2011-07-15 07:44:42 +00:00
uid,
self.pool.get('ir.model.data').get_object_reference(cr, uid, 'account', 'email_template_edi_invoice')[1],
[object.id],
context=context)</field>
2011-06-30 13:37:57 +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-07-15 07:44:42 +00:00
<field name= "name" > EDI Document - Invoice</field>
2011-06-30 13:37:57 +00:00
</record>
2011-07-15 07:44:42 +00:00
2011-06-30 13:37:57 +00:00
<!-- calling multi action in workflow.activity -->
<record id= "account.act_open" model= "workflow.activity" >
2011-07-15 07:44:42 +00:00
<field name= "action_id" ref= "ir_actions_server_edi_invoice" />
2011-06-30 13:37:57 +00:00
</record>
2011-07-15 07:44:42 +00:00
2011-06-30 13:37:57 +00:00
<!-- Email template -->
2011-07-15 07:44:42 +00:00
<record id= "email_template_edi_invoice" model= "email.template" >
2011-08-26 11:09:14 +00:00
<field name= "def_subject" > ${object.company_id.name} Invoice (Ref ${object.number or 'n/a' })</field>
<field name= "def_to" > ${object.address_invoice_id.email or ''}</field>
2011-06-30 13:37:57 +00:00
<field name= "object_name" ref= "account.model_account_invoice" />
2011-08-26 11:09:14 +00:00
<field name= "def_body_html" >
< 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); ">
2011-06-30 13:37:57 +00:00
2011-08-26 11:09:14 +00:00
< p> Hello ${object.address_invoice_id.name and ' ' or ''},< /p>
2011-08-29 07:39:56 +00:00
< p> You can click on the following link to preview, print and pay invoice: < br/>
< a href="${object._context.get('edi_web_invoice_url_view')}"> ${object._context.get('edi_web_invoice_url_view')} < /a>
2011-08-26 11:09:14 +00:00
< /p>
2011-07-15 07:44:42 +00:00
2011-06-30 13:37:57 +00:00
2011-08-26 11:09:14 +00:00
< p style="border-left: 1px solid #8e0000; margin-left: 30px;"> < strong> REFERENCES< /strong> < br /> Invoice number: < strong> ${object.number}< /strong> < br /> Invoice amount: < strong> ${object.amount_total} ${object.currency_id.name}< /strong> < br /> Invoice date: ${object.date_invoice or 'n/a'}< br /> Order reference: ${object.origin or 'n/a'}< br /> Your contact: < a href="mailto:${object.user_id.user_email or ''}?subject=Invoice%20${object.number}"> ${object.user_id.name}< /a> < /p>
2011-06-30 13:37:57 +00:00
2011-08-26 12:25:19 +00:00
${object.company_id.paypal_account and "< p> It is possible to pay with Paypal: < br/> < a href=\"https://www.paypal.com/cgi-bin/webscr?cmd=_xclick& business=%s& item_name=OpenERP%%20Invoice%%20%s& invoice=%s& amount=%s& currency_code=%s& button_subtype=services& no_note=1& bn=OpenERP_Invoice_PayNow_%s\"> < img src=\"https://www.paypalobjects.com/en_US/i/btn/btn_paynowCC_LG.gif\" style=\"margin-left: 100px; border: 0px; padding: 1px; text-decoration: none;\"/> < /a> < /p> "%(object.company_id.paypal_account, object.number and object.number.replace('/','%2f') or '', object.number and object.number.replace('/','%2f') or '', object.amount_total, object.currency_id.name, object.currency_id.name) or ''}
2011-08-26 11:09:14 +00:00
< p> If you have any question, do not hesitate to reply directly to this e-mail.< /p> < p> Thank you for choosing OpenERP!< br /> < /p> < div style="width: 375px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; overflow-x: hidden; overflow-y: hidden; zoom: 1; background-image: url(http://www.openerp.com/sites/default/files/red_gradient_bg.png); background-attachment: initial; background-origin: initial; background-clip: initial; background-color: rgb(142, 0, 0); border-top-left-radius: 5px 5px; border-top-right-radius: 5px 5px; border-bottom-right-radius: 0px 0px; border-bottom-left-radius: 0px 0px; background-position: 0% 0%; background-repeat: repeat no-repeat; "> < h3 style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 9px; padding-right: 14px; padding-bottom: 9px; padding-left: 14px; font-size: 12px; font-weight: normal; font-style: normal; color: rgb(255, 255, 255); "> < strong> ${object.company_id.name}< /strong> < /h3> < /div> < div style="width: 347px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 12px; padding-right: 14px; padding-bottom: 12px; padding-left: 14px; overflow-x: hidden; overflow-y: hidden; zoom: 1; line-height: 16px; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: rgb(242, 242, 242); "> < div> Contact:< a href="mailto:${object.user_id.user_email or ''}?subject=Invoice%20${object.number}"> ${object.user_id.name}< /a> < /div> < div> < /div> < /div> < /div> < p> < /p>
</field>
2011-08-24 13:06:53 +00:00
<field name= "def_body_text" >
2011-08-26 11:09:14 +00:00
Hello ${object.address_invoice_id.name and ' ' or ''},
You can click on the following link to preview, print and pay invoice:
2011-08-26 12:25:19 +00:00
${object._context.get('edi_web_invoice_url_view') or 'n/a'}
2011-08-26 11:09:14 +00:00
Invoice Number: *${object.number}*
Amount: *${object.amount_total} ${object.currency_id.name}*
Invoice date: ${object.date_invoice or 'n/a'}
Order reference: ${object.origin or 'n/a'}
2011-08-26 12:25:19 +00:00
Your contact: ${object.user_id.name} ${object.user_id.user_email and '< %s> '%(object.user_id.user_email) or ''}
2011-06-30 13:37:57 +00:00
2011-08-26 12:25:19 +00:00
${object.company_id.paypal_account and "It is possible to pay with Paypal: https://www.paypal.com/cgi-bin/webscr?cmd=_xclick& business=%s& item_name=OpenERP%%20Invoice%%20%s& invoice=%s& amount=%s& currency_code=%s& button_subtype=services& no_note=1& bn=OpenERP_Invoice_PayNow_%s"%(object.company_id.paypal_account, object.number and object.number.replace('/','%2f') or '', object.number and object.number.replace('/','%2f') or '', object.amount_total, object.currency_id.name, object.currency_id.name) or ''}
2011-07-15 07:44:42 +00:00
2011-08-26 11:09:14 +00:00
If you have any question, do not hesitate to reply directly to this e-mail.
2011-06-30 13:37:57 +00:00
2011-08-26 11:09:14 +00:00
Thank you for choosing our service!
2011-06-30 13:37:57 +00:00
2011-08-26 11:09:14 +00:00
--
${object.company_id.name}
2011-08-26 12:25:19 +00:00
Contact: ${object.user_id.name} ${object.user_id.user_email and '< %s> '%(object.user_id.user_email) or ''}
2011-07-15 10:59:13 +00:00
</field>
2011-06-30 13:37:57 +00:00
<field name= "template_language" > mako</field>
2011-07-15 07:44:42 +00:00
<field name= "name" > Mail Template of Invoice For EDI Document</field>
2011-06-30 13:37:57 +00:00
<field name= "model_int_name" > account.invoice</field>
2011-08-26 11:09:14 +00:00
<field name= "reply_to" > ${object.user_id.user_email or ''}</field>
2011-06-30 13:37:57 +00:00
</record>
</data>
</openerp>