Odoo Help

Welcome!

This community 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.

4

How can I override email template without changing original template file. [Closed]

By
Alexander
on 6/12/13, 12:02 PM 5,250 views

The Question has been closed

by
Sudhir Arya (SA)
on 06/13/2013 16:40:04

How can I override email template?

In my case, I need to change invitation email template. I'm found set_password_email view in auth_signup module, but I want to keep originaly file. Template is not contain <field name="arch" type="xml"> section:

        <!-- Email template for new users -->
        <record id="set_password_email" model="email.template">
            <field name="name">OpenERP Enterprise Connection</field>
            <field name="model_id" ref="base.model_res_users"/>
            <field name="email_from"><![CDATA[${object.company_id.name} <${object.company_id.email}>]]></field>
            <field name="email_to">${object.email}</field>
            <field name="subject"><![CDATA[${object.company_id.name} invitation to connect on OpenERP]]></field>
            <field name="body_html">
                <![CDATA[
                    <p>
                        ${object.name},
                    </p>
                    <p>
                        You have been invited to connect to "${object.company_id.name}" in order to get access to your documents in OpenERP.
                    </p>
                    <p>
                        To accept the invitation, click on the following link:
                    </p>
                    <ul>
                        <li><a href="${object.signup_url}">Accept invitation to "${object.company_id.name}"</a></li>
                    </ul>
                    <p>
                        Thanks,
                    </p>
                    <pre>
--
${object.company_id.name or ''}
${object.company_id.email or ''}
${object.company_id.phone or ''}
                    </pre>
                ]]>
            </field>
        </record>
4

Sudhir Arya (SA)

--Sudhir Arya (SA)--
10150
| 6 8 8
Ahmedabad, India
--Sudhir Arya (SA)--

Working as an OpenERP/Odoo developer and a Team Leader 

Top 5 Odoo contributor On Stackoverflow

LinkedIn

Blog

Stackoverflow

Sudhir Arya (SA)
On 6/13/13, 10:19 AM

You just need to overwrite the record id of xml file.

Like this:

    <record id="auth_signup.reset_password_email" model="email.template">
        <field name="name">Reset Password Custom Name</field>
    </record>

Here I have changed value of name field only. You can also change any value as per your wish.

I'm wondering why it does not work. It should.

Aron Lorinc
on 11/20/15, 6:40 AM

it was because some built-in templates are wrapped in a noupdate=1 block in the XML file

Aron Lorinc
on 11/20/15, 9:17 AM

i need to change body content but not working for me.

Virali
on 11/9/16, 5:28 AM

About This Community

This community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

2 follower(s)

Stats

Asked: 6/12/13, 12:02 PM
Seen: 5250 times
Last updated: 11/9/16, 5:29 AM