跳至內容
選單
此問題已被標幟
1 回覆
6022 瀏覽次數

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?

頭像
捨棄
最佳答案

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

頭像
捨棄
相關帖文 回覆 瀏覽次數 活動
3
1月 18
6423
3
5月 17
4891
2
12月 23
23502
0
5月 23
8692
2
11月 17
5775