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

Odoo 14自定义模块更新触发ParseError问题求助

Odoo 14 模块更新触发 ParseError (KeyError: 'view_order_form_inherit_new') 的解决方案

错误根源

自定义模块的/odoo-14/custom/addons/om_odoo_inheritance/views/sale_order.xml文件第4行,<record>标签的id与model属性写反:

  • 错误写法:将model设为视图IDview_order_form_inherit_new
  • 正确规则:<record>标签的model必须为ir.ui.view(视图模型),id才是自定义的视图标识

Odoo解析XML时无法识别错误的model值,因此抛出KeyError并引发ParseError。

修复步骤

  1. 打开目标XML文件:
    /odoo-14/custom/addons/om_odoo_inheritance/views/sale_order.xml
    
  2. 定位第4行的<record>标签,交换id和model的属性值:
    错误示例:
    <record model="view_order_form_inherit_new" id="ir.ui.view">
        <!-- 视图继承或字段定义内容 -->
    </record>
    
    修正后:
    <record id="view_order_form_inherit_new" model="ir.ui.view">
        <!-- 视图继承或字段定义内容 -->
    </record>
    
  3. 保存文件后,重新更新自定义模块即可恢复正常。

内容的提问来源于stack exchange,提问作者Prefortune Solution

相关产品推荐
方舟 Agent Plan

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

最近更新时间:2026.08.19 01:40:45