Javascript 如何在Odoo14中扩展qweb模板?
我正在尝试在过滤器的下拉列表中添加自定义菜单项 在Odoo14和owl框架中,一些菜单项存在于以下代码段内的基本模块中Javascript 如何在Odoo14中扩展qweb模板?,javascript,qweb,odoo-14,Javascript,Qweb,Odoo 14,我正在尝试在过滤器的下拉列表中添加自定义菜单项 在Odoo14和owl框架中,一些菜单项存在于以下代码段内的基本模块中 添加自定义筛选器 因此,在我的自定义模块中,我将执行以下操作来添加自定义项 自定义项 但它没有出现。有什么建议吗?Odoo14 owl框架您可以使用xpath扩展模板 你可以这样用 <?xml version="1.0" encoding="UTF-8"?> <templates id="templat
添加自定义筛选器
因此,在我的自定义模块中,我将执行以下操作来添加自定义项
自定义项
但它没有出现。有什么建议吗?Odoo14 owl框架您可以使用xpath扩展模板 你可以这样用
<?xml version="1.0" encoding="UTF-8"?>
<templates id="template" xml:space="preserve">
<t t-name="CustomFilterItem" t-inherit="web.CustomFilterItem" t-inherit-mode="extension" owl="1">
<xpath expr="//button[hasclass('o_add_custom_filter dropdown-item')]" position="before">
//your code
</xpath>
</templates>
//你的代码
Odoo14 owl框架您可以使用xpath扩展模板
你可以这样用
<?xml version="1.0" encoding="UTF-8"?>
<templates id="template" xml:space="preserve">
<t t-name="CustomFilterItem" t-inherit="web.CustomFilterItem" t-inherit-mode="extension" owl="1">
<xpath expr="//button[hasclass('o_add_custom_filter dropdown-item')]" position="before">
//your code
</xpath>
</templates>
//你的代码