odoo templates的继承

在需求里需要把一个templates 取消核销 按钮去掉
在这里插入图片描述
刚开始一直写在 view视图里,完全改不掉,
后来写在了qweb里,没有问题,所以qweb以及qweb继承一定要写在qweb
在这里插入图片描述
在这里插入图片描述
最后写完的代码

<?xml version="1.0" encoding="UTF-8"?>
<templates id="template" xml:space="preserve">
  <t t-extend="PaymentPopOver">
    <t t-jquery="button.js_unreconcile_payment" t-operation="replace"/>
 </t>
</templates>
# t-extend 是继承的t-name
# t-jquery 定位要进行操作的元素

在这里插入图片描述

猜你喜欢

转载自blog.csdn.net/weixin_42464956/article/details/109603896
今日推荐