[FIX] edi: correct datas of email_template
bzr revid: hmo@tinyerp.com-20110915053043-a6f2d7ecwfbzspu1
This commit is contained in:
parent
413f17e8d9
commit
fa80282887
|
@ -4,10 +4,10 @@
|
|||
<!--Export edi document -->
|
||||
<record id="ir_actions_server_edi_invoice" model="ir.actions.server">
|
||||
<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])})
|
||||
if not object.partner_id.opt_out: self.pool.get('email.template').generate_mail(cr,
|
||||
if not object.partner_id.opt_out: self.pool.get('email.template').send_mail(cr,
|
||||
uid,
|
||||
self.pool.get('ir.model.data').get_object_reference(cr, uid, 'account', 'email_template_edi_invoice')[1],
|
||||
[object.id],
|
||||
object.id,
|
||||
context=context)</field>
|
||||
<field eval="6" name="sequence"/>
|
||||
<field name="state">code</field>
|
||||
|
@ -26,10 +26,14 @@ if not object.partner_id.opt_out: self.pool.get('email.template').generate_mail(
|
|||
|
||||
<!--Email template -->
|
||||
<record id="email_template_edi_invoice" model="email.template">
|
||||
<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>
|
||||
<field name="object_name" ref="account.model_account_invoice"/>
|
||||
<field name="def_body_html">
|
||||
<field name="name">Mail Template of Invoice For EDI Document</field>
|
||||
<field name="reply_to">${object.user_id.user_email or ''}</field>
|
||||
<field name="email_from">${object.user_id.user_email or ''}</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"/>
|
||||
<field name="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); ">
|
||||
|
||||
<p> Hello ${object.address_invoice_id.name and ' ' or ''},</p>
|
||||
|
@ -44,7 +48,7 @@ ${object.company_id.paypal_account and "<p>It is possible to pay with Payp
|
|||
|
||||
<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>
|
||||
<field name="def_body_text">
|
||||
<field name="body_text">
|
||||
Hello ${object.address_invoice_id.name and ' ' or ''},
|
||||
|
||||
You can click on the following link to preview, print and pay invoice:
|
||||
|
@ -67,10 +71,7 @@ Thank you for choosing our service!
|
|||
${object.company_id.name}
|
||||
Contact: ${object.user_id.name} ${object.user_id.user_email and '<%s>'%(object.user_id.user_email) or ''}
|
||||
</field>
|
||||
<field name="template_language">mako</field>
|
||||
<field name="name">Mail Template of Invoice For EDI Document</field>
|
||||
<field name="model_int_name">account.invoice</field>
|
||||
<field name="reply_to">${object.user_id.user_email or ''}</field>
|
||||
|
||||
</record>
|
||||
</data>
|
||||
</openerp>
|
||||
|
|
|
@ -123,13 +123,12 @@
|
|||
-
|
||||
!python {model: account.invoice}: |
|
||||
|
||||
invoice_old = self.browse(cr, uid, ref("customer_invoice_test"))
|
||||
new_partner_id = self.pool.get('res.partner').name_search(cr, uid, invoice_old.company_id.name)
|
||||
new_partner_id = self.pool.get('res.partner').name_search(cr, uid, "Thomson pvt. ltd.")
|
||||
assert new_partner_id, 'Partner is not created of Supplier'
|
||||
ids = self.search(cr, uid, [('partner_id','=',new_partner_id[0][0]),('reference','=',"SAJ/2011/002")])
|
||||
assert ids, 'Invoice does not have created of party'
|
||||
invoice_new = self.browse(cr, uid, ids[0])
|
||||
assert invoice_new.reference == invoice_old.internal_number, "internal number is not stored in reference"
|
||||
assert invoice_new.reference == "SAJ/2011/002", "internal number is not stored in reference"
|
||||
assert invoice_new.reference_type == 'none', "reference type is not set to 'None'"
|
||||
assert invoice_new.internal_number == False, "internal number is not reset"
|
||||
assert invoice_new.journal_id.id, "journal id is not selected"
|
||||
|
|
|
@ -382,5 +382,6 @@ class email_template(osv.osv):
|
|||
if context.has_key('default_type'):
|
||||
del context['default_type']
|
||||
attachment_ids.append(ir_attachment.create(cr, uid, attachment_data, context))
|
||||
return message_id
|
||||
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||
|
|
|
@ -3,11 +3,11 @@
|
|||
<data>
|
||||
<!--Export edi document -->
|
||||
<record id="ir_actions_server_edi_purchase" model="ir.actions.server">
|
||||
<field name="code">context.update({'edi_web_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])})
|
||||
if not object.partner_id.opt_out: self.pool.get('email.template').generate_mail(cr,
|
||||
<field name="code">context.update({'edi_web_purchase_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])})
|
||||
if not object.partner_id.opt_out: self.pool.get('email.template').send_mail(cr,
|
||||
uid,
|
||||
self.pool.get('ir.model.data').get_object_reference(cr, uid, 'purchase', 'email_template_edi_purchase')[1],
|
||||
[object.id],
|
||||
object.id,
|
||||
context=context)</field>
|
||||
<field eval="8" name="sequence"/>
|
||||
<field name="state">code</field>
|
||||
|
@ -19,23 +19,25 @@ if not object.partner_id.opt_out: self.pool.get('email.template').generate_mail(
|
|||
|
||||
|
||||
<!--calling multi action in workflow.activity -->
|
||||
<!--<record id="purchase.act_confirmed" model="workflow.activity">
|
||||
<record id="purchase.act_confirmed" model="workflow.activity">
|
||||
<field name="action_id" ref="ir_actions_server_edi_purchase"/>
|
||||
</record> -->
|
||||
</record>
|
||||
|
||||
|
||||
<!--Email template -->
|
||||
<record id="email_template_edi_purchase" model="email.template">
|
||||
<field name="def_subject">${object.company_id.name} - Purchase Order ${object.name}</field>
|
||||
<field name="def_to">${object.partner_address_id.email}</field>
|
||||
<field name="object_name" ref="purchase.model_purchase_order"/>
|
||||
<field name="use_sign">True</field>
|
||||
<field name="def_body_html">
|
||||
<field name="name">Mail Template of Purchase Order For EDI Document</field>
|
||||
<field name="email_from">${object.validator.user_email or ''}</field>
|
||||
<field name="reply_to">${object.validator.user_email or ''}</field>
|
||||
<field name="subject">${object.company_id.name} - Purchase Order ${object.name}</field>
|
||||
<field name="email_to">${object.partner_address_id.email}</field>
|
||||
<field name="model_id" ref="purchase.model_purchase_order"/>
|
||||
<field name="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); ">
|
||||
|
||||
<p> Hello ${object.partner_address_id.name and ' ' or ''},</p>
|
||||
<p> You can click on the following link to preview, print and pay invoice: <br/>
|
||||
<a href="${object._context.get('edi_web_url_view')}">${object._context.get('edi_web_url_view')} </a>
|
||||
<a href="${object._context.get('edi_web_purchase_url_view')}">${object._context.get('edi_web_purchase_url_view')} </a>
|
||||
</p>
|
||||
|
||||
|
||||
|
@ -45,12 +47,12 @@ ${object.company_id.paypal_account and "<p>It is possible to pay with Payp
|
|||
|
||||
<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.validator.user_email or ''}?subject=Order%20${object.name}">${object.validator.name}</a></div> <div> </div> </div> </div> <p> </p>
|
||||
</field>
|
||||
<field name="def_body_text">
|
||||
<field name="body_text">
|
||||
Hello ${object.partner_address_id.name and ' ' or ''},
|
||||
|
||||
You can click on the following link to preview, print and pay invoice:
|
||||
|
||||
${object._context.get('edi_web_url_view') or 'n/a'}
|
||||
${object._context.get('edi_web_purchase_url_view') or 'n/a'}
|
||||
|
||||
Order Number: *${object.name}*
|
||||
Amount: *${object.amount_total}*
|
||||
|
@ -67,10 +69,7 @@ Thank you for choosing our service!
|
|||
${object.company_id.name}
|
||||
Contact: ${object.validator.name} ${object.validator.user_email and '<%s>'%(object.validator.user_email) or ''}
|
||||
</field>
|
||||
<field name="template_language">mako</field>
|
||||
<field name="name">Mail Template of Purchase Order For EDI Document</field>
|
||||
<field name="model_int_name">purchase.order</field>
|
||||
<field name="reply_to">${object.validator.user_email or ''}</field>
|
||||
|
||||
</record>
|
||||
</data>
|
||||
</openerp>
|
||||
|
|
|
@ -3,11 +3,11 @@
|
|||
<data>
|
||||
<!--Export edi document -->
|
||||
<record id="ir_actions_server_edi_sale" model="ir.actions.server">
|
||||
<field name="code">context.update({'edi_web_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])})
|
||||
if not object.partner_id.opt_out: self.pool.get('email.template').generate_mail(cr,
|
||||
<field name="code">context.update({'edi_web_sale_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])})
|
||||
if not object.partner_id.opt_out: self.pool.get('email.template').send_email(cr,
|
||||
uid,
|
||||
self.pool.get('ir.model.data').get_object_reference(cr, uid, 'sale', 'email_template_edi_sale')[1],
|
||||
[object.id],
|
||||
object.id,
|
||||
context=context)</field>
|
||||
<field eval="7" name="sequence"/>
|
||||
<field name="state">code</field>
|
||||
|
@ -26,16 +26,18 @@ if not object.partner_id.opt_out: self.pool.get('email.template').generate_mail(
|
|||
|
||||
<!--Email template -->
|
||||
<record id="email_template_edi_sale" model="email.template">
|
||||
<field name="def_subject">${object.company_id.name} - Sale Order ${object.name}</field>
|
||||
<field name="def_to">${object.partner_invoice_id.email}</field>
|
||||
<field name="object_name" ref="sale.model_sale_order"/>
|
||||
<field name="use_sign">True</field>
|
||||
<field name="def_body_html">
|
||||
<field name="name">Mail Template of Sale Order For EDI Document</field>
|
||||
<field name="reply_to">${object.user_id.user_email or ''}</field>
|
||||
<field name="email_from">${object.user_id.user_email or ''}</field>
|
||||
<field name="subject">${object.company_id.name} - Sale Order ${object.name}</field>
|
||||
<field name="email_to">${object.partner_invoice_id.email}</field>
|
||||
<field name="model_id" ref="sale.model_sale_order"/>
|
||||
<field name="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); ">
|
||||
|
||||
<p> Hello ${object.partner_invoice_id.name and ' ' or ''},</p>
|
||||
<p> You can click on the following link to preview, print and pay invoice: <br/>
|
||||
<a href="${object._context.get('edi_web_url_view')}">${object._context.get('edi_web_url_view')} </a>
|
||||
<a href="${object._context.get('edi_web_sale_url_view')}">${object._context.get('edi_web_sale_url_view')} </a>
|
||||
</p>
|
||||
|
||||
|
||||
|
@ -45,12 +47,12 @@ ${object.company_id.paypal_account and "<p>It is possible to pay with Payp
|
|||
|
||||
<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=Order%20${object.name}">${object.user_id.name}</a></div> <div> </div> </div> </div> <p> </p>
|
||||
</field>
|
||||
<field name="def_body_text">
|
||||
<field name="body_text">
|
||||
Hello ${object.partner_invoice_id.name and ' ' or ''},
|
||||
|
||||
You can click on the following link to preview, print and pay invoice:
|
||||
|
||||
${object._context.get('edi_web_url_view') or 'n/a'}
|
||||
${object._context.get('edi_web_sale_url_view') or 'n/a'}
|
||||
|
||||
Order Number: *${object.name}*
|
||||
Amount: *${object.amount_total}*
|
||||
|
@ -67,10 +69,6 @@ Thank you for choosing our service!
|
|||
${object.company_id.name}
|
||||
Contact: ${object.user_id.name} ${object.user_id.user_email and '<%s>'%(object.user_id.user_email) or ''}
|
||||
</field>
|
||||
<field name="template_language">mako</field>
|
||||
<field name="name">Mail Template of Sale Order For EDI Document</field>
|
||||
<field name="model_int_name">sale.order</field>
|
||||
<field name="reply_to">${object.user_id.user_email or ''}</field>
|
||||
</record>
|
||||
</data>
|
||||
</openerp>
|
||||
|
|
Loading…
Reference in New Issue