Passa al contenuto
Menu
È necessario essere registrati per interagire con la community.
La domanda è stata contrassegnata
1 Rispondi
6196 Visualizzazioni

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
Abbandona
Risposta migliore

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
Abbandona
Post correlati Risposte Visualizzazioni Attività
3
gen 18
6531
3
mag 17
4980
2
dic 23
23742
0
mag 23
8848
2
nov 17
5858