Odoo Help


Modify email.template through a module [Closed]

on 6/30/15, 11:41 AM 2,873 views

The Question has been closed for reason: not a real question

Serpent Consulting Services Pvt. Ltd.
on 07/02/2015 06:36:07

Hi !

I know email template for invoices are defined under account/edi/invoice_action_data.xml, inside a CDATA tag, in the body_html field.

But, this part of the file if inside a data tag which has noupdate enabled.

Knowing that, is it possible to create a module to override invoice email (or any email template) ?

Because, you know, copy pasting the same code over multiple databases can be a pain, when you can just install your module and be done with it.


On 7/1/15, 3:33 AM

I used a workaround, in the end.

I just created a new email template.


Emipro Technologies Pvt. Ltd.

--Emipro Technologies Pvt. Ltd.--
| 6 7 8
Rajkot, India
--Emipro Technologies Pvt. Ltd.--

Being an emerging leader in IT market since 2011, Emipro Technologies Pvt. Ltd. has been providing a wide range of business solutions in Odoo & Magento. We are pleased to have a large pool of contented customers with our meticulous work in the domain of ERP & e-Commerce. A ray of relief & satisfaction to  our customers heart by our successful deployment in their organization, purely represents our success in Odoo platform. Hence, we take pride for being an Odoo partner with a vision of expanding our strategic alliances with our customers to offer them high value-added, trustworthy & cost effective solutions.


Since establishment, our business has span across 11 countries of the world. Our customers are companies of all sizes ranging from start-ups to large enterprises, who realize that they need a professional business solutions to generate revenue streams, establish proper communication channels or streamline business operations. Standing with strong determination of customer satisfaction, observing each minute detail of their business processes, providing proper guidance and moving forth to develop product accordingly adds our value and reliability among our customers. 


We are blessed with efficient, passionate & eclectic young developers who have come across almost all kinds of business profiles, working with full dedication, applying creativity & new features in existing modules and completing customer's projects successfully on predefined target. Our in-depth knowledge while giving business solutions in Odoo allows us to offer following services to our customers :


  • Consulting
  • Installation, Configuration & Customization
  • Training & Support
  • Maintenance
  • Upgradation
  • Documentation
  • Crafting community modules
  • Drafting videos on demand
  • Smart Apps development

We will be :) to welcome you @ www.emiprotechnologies.com to solve any kind of your business needs around Odoo. However we are just an inch away from you by email info@emiprotechnologies.com or a tweet to @EmiproTech

Emipro Technologies Pvt. Ltd.
On 7/1/15, 1:05 AM


You can update any of the email template using custom module. To override invoice email you need to just redefine that template inside your custom module as like below.

<record id="account.email_template_edi_invoice" model="email.template">

<field name="name">Invoice - Send by Email</field>

<field name="email_from">${(object.user_id.email or object.company_id.email or 'noreply@localhost')|safe}</field>

<field name="subject">${object.company_id.name|safe} Invoice (Ref ${object.number or 'n/a'})</field>

<field name="partner_to">${object.partner_id.id}</field>

<field name="model_id" ref="account.model_account_invoice"/>

<field name="auto_delete" eval="True"/>

<field name="report_template" ref="account_invoices"/>

<field name="report_name">Invoice_${(object.number or '').replace('/','_')}_${object.state == 'draft' and 'draft' or ''}</field>

<field name="lang">${object.partner_id.lang}</field>

<field name="body_html">

<![CDATA[ "Write down your own template code here" ]] >



 It will override the existing email template of invoice.

I hope it will help you.

Thanks, I'll definitely try this.

on 7/1/15, 3:15 AM

No, that doesn't work.

on 7/1/15, 3:23 AM

I can also confirm that this doesn't work. For some reason it just does not want to update the email template.

Limitless Virtual Enterprise, Andre de Kock
on 7/1/15, 8:33 AM

Yeah, in v8, the update=1 on the original record prevents future overrides. See my answer here for a workaround: https://www.odoo.com/fr_FR/forum/help-1/question/how-to-override-your-company-data-through-a-custom-module-in-v8-87510 This could be applied to any object, or implemented directly into the Model class I suppose.

on 7/1/15, 10:40 AM

About This Community

This platform is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.


Odoo Training Center

Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.

Test it now

Question tools

1 follower(s)


Asked: 6/30/15, 11:41 AM
Seen: 2873 times
Last updated: 7/2/15, 6:36 AM