2011-10-06 16:34:25 +00:00
<?xml version="1.0" ?>
<openerp >
<data >
<!-- Export edi document -->
2012-04-02 12:36:51 +00:00
<!--
2011-10-06 16:34:25 +00:00
<record id= "ir_actions_server_edi_purchase" model= "ir.actions.server" >
2011-11-08 12:07:54 +00:00
<field name= "code" > if not object.partner_id.opt_out: object.edi_export_and_email(template_ext_id='purchase.email_template_edi_purchase', context=context)</field>
2011-10-06 16:34:25 +00:00
<field name= "state" > code</field>
<field name= "type" > ir.actions.server</field>
<field name= "model_id" ref= "purchase.model_purchase_order" />
<field name= "condition" > True</field>
<field name= "name" > Auto-email confirmed purchase orders</field>
</record>
2012-04-02 12:36:51 +00:00
-->
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" eval= "{'search_default_model_id': ref('purchase.model_purchase_order')}" />
</record>
2011-10-06 16:34:25 +00:00
</data>
<!-- 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 purchase.order confirmed activity -->
2012-04-02 12:36:51 +00:00
<!--
2011-10-06 16:34:25 +00:00
<record id= "purchase.act_confirmed" model= "workflow.activity" >
<field name= "action_id" ref= "ir_actions_server_edi_purchase" />
</record>
2012-04-02 12:36:51 +00:00
-->
2011-10-06 16:34:25 +00:00
<!-- Email template -->
<record id= "email_template_edi_purchase" model= "email.template" >
<field name= "name" > Automated Purchase Order Notification Mail</field>
2012-08-10 14:43:39 +00:00
<field name= "email_from" > ${object.validator.email or ''}</field>
2011-10-06 16:34:25 +00:00
<field name= "subject" > ${object.company_id.name} Order (Ref ${object.name or 'n/a' })</field>
2012-03-05 13:25:39 +00:00
<field name= "email_to" > ${object.partner_id.email}</field>
2011-10-06 16:34:25 +00:00
<field name= "model_id" ref= "purchase.model_purchase_order" />
2011-11-03 01:10:34 +00:00
<field name= "auto_delete" eval= "True" />
2011-10-06 16:34:25 +00:00
<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); " >
2012-03-05 13:25:39 +00:00
<p > Hello${object.partner_id.name and ' ' or ''}${object.partner_id.name or ''},</p>
2011-10-06 16:34:25 +00:00
2012-05-25 14:35:49 +00:00
<p > Here is a ${object.state in ('draft', 'sent') and 'request for quotation' or 'purchase order confirmation'} from ${object.company_id.name}: </p>
2011-10-06 16:34:25 +00:00
<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.partner_ref:
Your reference: ${object.partner_ref}<br />
% endif
2012-08-10 14:43:39 +00:00
Your contact: <a href= "mailto:${object.validator.email or ''}?subject=Order%20${object.name}" > ${object.validator.name}</a>
2011-10-06 16:34:25 +00:00
</p>
<p >
2012-05-25 14:35:49 +00:00
You can view the ${object.state in ('draft', 'sent') and 'request for quotation' or 'order confirmation'} document and download it using the following link:
2011-10-06 16:34:25 +00:00
</p>
2011-10-26 00:01:10 +00:00
<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;"
2011-10-06 16:34:25 +00:00
href="${ctx.get('edi_web_url_view') or ''}">View Order</a>
<br />
<p > If you have any question, do not hesitate to contact us.</p>
2011-11-05 02:29:25 +00:00
<p > Thank you!</p>
2011-10-06 16:34:25 +00:00
<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;" >
<h3 style= "margin: 0px; padding: 2px 14px; font-size: 12px; color: #FFF;" >
2011-10-06 16:34:25 +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-10-06 16:34:25 +00:00
% 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>
<field name= "body_text" > < ![CDATA[
2012-03-05 13:25:39 +00:00
Hello${object.partner_id.name and ' ' or ''}${object.partner_id.name or ''},
2011-10-06 16:34:25 +00:00
2012-05-25 14:35:49 +00:00
Here is a ${object.state in ('draft', 'sent') and 'request for quotation' or 'purchase order confirmation'} from ${object.company_id.name}:
2011-10-06 16:34:25 +00:00
| Order number: *${object.name}*
| Order total: *${object.amount_total} ${object.pricelist_id.currency_id.name}*
| Order date: ${object.date_order}
% if object.origin:
| Order reference: ${object.origin}
% endif
% if object.partner_ref:
| Your reference: ${object.partner_ref}<br />
% endif
2012-08-10 14:43:39 +00:00
| Your contact: ${object.validator.name} ${object.validator.email and '< %s>'%(object.validator.email) or ''}
2011-10-06 16:34:25 +00:00
2012-05-25 14:35:49 +00:00
You can view the ${object.state in ('draft', 'sent') and 'request for quotation' or 'order confirmation'} and download it using the following link:
2012-05-25 13:17:15 +00:00
${ctx.get('edi_web_url_view') or 'n/a'}
If you have any question, do not hesitate to contact us.
Thank you!
2011-10-06 16:34:25 +00:00
--
2012-08-10 14:43:39 +00:00
${object.validator.name} ${object.validator.email and '< %s>'%(object.validator.email) or ''}
2011-10-06 16:34:25 +00:00
${object.company_id.name}
% 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
]]></field>
</record>
</data>
2012-04-02 12:36:51 +00:00
</openerp>