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

Template overriding conflicts - if I overide a same Template twice or overrides in different plug-ins, Which one will affected?

I have tried overriding Templates for Front end pages, events and so on.. Somehow seems to be working and still wondering what happens If I overrides same templates one and more time and in different addons?

Avatar
Zrušit
Nejlepší odpověď

If two or more  templates inherit same parent template they can have same priorities. It may produce conflicts and unexpected behavior. What you need is just set priority explicitly in your template:


<template id="..." inherit_id="..." priority="8" ..>
    <xpath expr="..." position="...">
     ...
     </xpath>
</template>


<!-- or -->


<record id="..." model="ir.ui.view">
    ...
    <field name="inherit_id" ref="..."/>   
    <field name="priority" eval="8" />
    <field name="arch" type="xml">
         <xpath expr="..." position="...">
         </xpath>
     </field>
</record>


Less priority means prior execution.Default priority is 16. Hope this may help you

Avatar
Zrušit
Related Posts Odpovědi Zobrazení Aktivita
3
led 18
6369
3
kvě 17
4833
2
pro 23
23429
0
kvě 23
8636
2
lis 17
5731