You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

如何在Odoo 17中移除采购订单的PurchaseDashBoard

在Odoo 17中移除采购订单模块的PurchaseDashBoard

你提供的代码片段是Odoo采购模块中,为看板视图和列表视图添加PurchaseDashBoard的模板继承逻辑。要移除这个仪表盘,我们可以通过模板继承替换/删除目标节点的方式实现,具体步骤如下:

解决方案代码

移除看板视图中的仪表盘

在自定义模块的视图文件中添加以下XML代码:

<templates>
    <t t-name="custom_purchase.RemoveKanbanDashboard" t-inherit="purchase.PurchaseKanbanView" t-inherit-mode="extension">
        <xpath expr="//PurchaseDashBoard" position="replace"/>
    </t>
</templates>

移除列表视图中的仪表盘

同样在自定义模块的视图文件中添加:

<templates>
    <t t-name="custom_purchase.RemoveListDashboard" t-inherit="purchase.PurchaseListView" t-inherit-mode="extension">
        <xpath expr="//PurchaseDashBoard" position="replace"/>
    </t>
</templates>

操作步骤

  1. 新建自定义模块(示例命名为custom_purchase),在__manifest__.py中添加依赖:'depends': ['purchase']
  2. 在模块的views目录下创建上述XML文件(如purchase_remove_dashboard.xml)
  3. 在__manifest__.py的data列表中注册该文件:'data': ['views/purchase_remove_dashboard.xml']
  4. 升级自定义模块,采购订单的看板和列表视图中的仪表盘将被移除

界面参考

Odoo采购订单界面

内容的提问来源于stack exchange,提问作者Ahmed Tahsen

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.06.18 13:57:03