【发布时间】:2021-11-23 17:47:23
【问题描述】:
我需要用我自己的内容替换sale模块的模板variants。
我的代码-xml:
<template id="my_variants" inherit_id="sale.variants">
<xpath expr="." position="replace">
<!-- <p>My codee, this is not shown</p>-->
</xpath>
</template>
使用以前的代码我的新模板不起作用,我做错了什么?如何解决?
注意:使用<t t-call = "web.layout"> 与xpath 后面的所有内容;我的模板有效,但显示 JS 错误
带有错误 JS 的代码:
<template id="my_variants" inherit_id="sale.variants">
<xpath expr="." position="replace"><!-- template works but with error JS-->
<t t-call="web.layout" >
<!-- <p>My codee, my code, this is displayed and</p>-->
</t>
</xpath>
</template>
JS 错误:
web.assets_common_lazy.js:4497 Uncaught (in promise) TypeError: Cannot 读取未定义的属性'user_context'
【问题讨论】: