Přejít na obsah
Menu
You need to be registered to interact with the community.
This question has been flagged
2 Odpovědi
13105 Zobrazení

Hi, 

How to Inherit owl template in odoo Version 14.0?

E.g 

<template id="template" xml:space="preserve">
    <t t-name="DemoExample">
        <div class="demo-one" owl="1">
            <p>odoo</p>
        </div>
    </t>
</template>
Avatar
Zrušit
Nejlepší odpověď

you must create a new xml file using this template (DO NOT FORGET OWL="1")


<?xml version="1.0" encoding="utf-8" ?>


<templates xml:space="preserve">


    <t t-inherit="addon_name.DemoExample" t-inherit-mode="extension" owl="1">


        <xpath expr="//xpath_expression" position="attributes or replace or after or before">


            <attribute name="field_attribut">value</attribute>


        </xpath>


    </t>


</templates>



And add it in the __manifest__.py file of your custom addon in asset part.

Avatar
Zrušit
Nejlepší odpověď

You could follow this example. These example add a new property to a sub-component

    <t t-inherit="mail.Discuss.content" t-inherit-mode="extension">

        <xpath expr="//ThreadView" position="attributes">

            <attribute name="mail_classic_view">true</attribute>

        </xpath>

    </t>

Avatar
Zrušit
Related Posts Odpovědi Zobrazení Aktivita
1
kvě 24
3156
1
dub 24
26775
1
kvě 23
4002
1
lis 22
2608
2
čvc 22
3313