Skip to Content
เมนู
คุณต้องลงทะเบียนเพื่อโต้ตอบกับคอมมูนิตี้
คำถามนี้ถูกตั้งค่าสถานะ
1 ตอบกลับ
8407 มุมมอง

My question relate to the extension of QWEB templates written in other modules, I found two ways to do it:

<template id="website.layout_footer_copyright" inherit_id="website.layout" name="Footer Copyright">

<xpath expr="//footer" position="inside"> </xpath>
</template>

and

<templates id="template">

<t t-extend="DebugWidget">
<t t-jquery="div.content" t-operation="append">
</t>
</t>
</template

By searching through the code in Odoo I found out that both methods were used, though only the second one is documented. Is there some situations where one is preferred to the other?

อวตาร
ละทิ้ง
คำตอบที่ดีที่สุด

it's similar to https://www.odoo.com/forum/help-1/question/difference-between-xpath-and-t-jquery-154454#answer-154505

server-side template rending use `inherit_id` while client-side template use t-extend. 

อวตาร
ละทิ้ง
Related Posts ตอบกลับ มุมมอง กิจกรรม
2
ม.ค. 22
3519
5
ธ.ค. 23
27192
0
มิ.ย. 23
1825
How to modify a qweb template? แก้ไขแล้ว
2
ธ.ค. 22
22835
0
ก.ค. 21
2042