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

Odoo13安装school模块报ir.ui.menu.action值错误如何解决?

问题排查及解决方案

报错原因

你代码里存在2处语法错误,共同引发了本次解析报错:

  • help字段标签未正确闭合:你写的<field name="help" type="html缺少右双引号和右尖括号,导致XML解析逻辑混乱,Odoo错误将后续内容识别为动作参数,最终生成了非法的菜单关联值form,189
  • ir.actions.act_window的type字段值错误:ir.actions.act_window模型的type字段固定值为ir.actions.act_window,你错误填写为视图类型form,进一步导致动作关联异常

修复后的完整代码

<odoo>
    <data>
        <record id="student_menu_action" model="ir.actions.act_window">
            <field name="name">Students</field>
            <field name="res_model">student.student</field>
            <field name="view_mode">tree,form</field>
            <field name="domain">[]</field>
            <!-- 修复help标签闭合问题 -->
            <field name="help" type="html">
                <p class="oe_view_nocontent_create">Create The First Student
                </p>
            </field>
        </record>

        <menuitem id="school_menu" name="School"/>
        <menuitem id="school_student_menu" parent="school_menu" name="Student" action="student_menu_action"/>
    </data>
</odoo>

验证操作

修复后重启Odoo服务,再重新升级安装自定义模块即可。

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

相关产品推荐
方舟 Agent Plan

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

最近更新时间:2026.10.01 00:48:02