KbiR
KbiR

Reputation: 4174

Inherit a qweb template (t-name) in odoo 10

I am trying to extend a qweb template view. But it's not working. Here is my code.

my_module/static/src/xml/website.xml

<?xml version="1.0" encoding="UTF-8"?>
<templates id="template" xml:space="preserve">
<t t-extend="website.homepage_editor_welcome_message" >
<t t-jquery=".lead" t-operation="replace">
    <p class="lead second_head">Let's start designing.</p>
</t>
</t>
</templates>    

Here is the original code from the website module.

<div t-name="website.homepage_editor_welcome_message" class="container text-center o_homepage_editor_welcome_message">
    <h2 class="mt0">Welcome to your <b>Homepage</b>!</h2>
    <p class="lead">Let's start designing.</p>
    <div class="o_tooltip_container">Follow all the <div class="o_tooltip bottom"/> signs to get your website ready in no time.</div>
</div>

And add the XML file in __manifest__.py like below.

 'qweb': ['static/src/xml/website.xml'],

But no change in website.

How can i do it?

Upvotes: 0

Views: 2201

Answers (1)

Kareem Abuzaid
Kareem Abuzaid

Reputation: 96

The only way I was able to find to be able to inherit a Qweb template declared with t-name is to redefine it in your custom module, change the code directly. You will be overriding the existing one.

Upvotes: 0

Related Questions