Files
odoo_source/addons/web/static/lib
Aaron Bohy b558cb7996 [FIX] web: qweb old inheritance mechanism
Before this commit, defining a extension of a template by using the
combination of directives 't-name' and 't-extend' ignored potential
extensions that could have been defined beforehand.

For instance, let's assume the following templates.
```xml
<t t-name="a">
    <div><span>1</span></div>
</t>
<t t-extend="a">
    <t t-jquery="span" t-operation="replace">
        <span>2</span>
    </t>
</t>
<t t-name="b" t-extend="a">
    <t t-jquery="div" t-operation="append">
        <span>b</span>
    </t>
</t>
```
Rendering template "b" displayed "1b" whereas we would expect "2b".

Moreover, when the extended template is itself an extension of
another template:
```xml
<t t-name="a">
    <div><span>a</span></div>
</t>
<t t-name="b" t-extend="a">
    <t t-jquery="div" t-operation="append">
        <span>b</span>
    </t>
</t>
<t t-name="c" t-extend="b">
    <t t-jquery="div" t-operation="append">
        <span>c</span>
    </t>
</t>
```
Rendering template "a" displayed "a", template "b" displayed "ab",
but template "c" displayed "ac", whereas we would expect "abc".

With this commit, other extensions done to a template are kept when
a new extension is defined. It relies on the templates order, and
takes into account all extensions that have *already* been defined.
This is exactly how the new qweb inheritance mechanism (using
't-inherit' and 't-inherit-mode') behaves.

closes odoo/odoo#54315

Signed-off-by: Lucas Perais (lpe) <lpe@odoo.com>
2020-07-10 11:53:23 +00:00
..
…
2020-06-09 08:04:03 +00:00