继承odoo 10中的qweb模板(t-name)

问题描述 投票:0回答:2

我正在尝试扩展 qweb 模板视图。但这不起作用。 这是我的代码。

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>    

这是来自

website
模块的原始代码。

<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>

并在

__manifest__.py
中添加XML文件,如下所示。

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

但网站没有变化。

我该怎么做?

odoo odoo-10
2个回答
0
投票

我发现能够继承使用 t-name 声明的 Qweb 模板的唯一方法是在自定义模块中重新定义它,直接更改代码。您将覆盖现有的。


0
投票

嗨,这对我不起作用,兄弟

© www.soinside.com 2019 - 2024. All rights reserved.