问题描述
安装自定义模块后,我无法升级基本模块,甚至无法安装新的自定义模块。但是,当我卸载自定义模块时,我可以升级 base 并且一切正常,因此很清楚导致问题的原因。
我不明白的是为什么自定义模块不允许基础升级,它工作得很好并且安装没有问题。自定义模块只是向 res.users 表单视图添加一个字段,并使另一个不可见。但同样,一旦我尝试升级 base 或任何其他自定义模块的依赖项,我就会在下面收到此错误(仅放置它的主要部分)
Traceback (most recent call last):
File "/opt/odoo/odoo-server/odoo/http.py",line 638,in _handle_exception
return super(JsonRequest,self)._handle_exception(exception)
File "/opt/odoo/odoo-server/odoo/http.py",line 314,in _handle_exception
raise exception.with_traceback(None) from new_cause
odoo.tools.convert.ParseError: while parsing /opt/odoo/custom/addons/custom_module/views/views.xml:3,near
<record id="view_users_form" model="ir.ui.view">
<field name="name">res.users.form.inherit</field>
<field name="model">res.users</field>
<field name="type">form</field>
<field name="inherit_id" ref="base.view_users_form"/>
<field name="arch" type="xml">
<data><xpath expr="//field[@name='sel_groups_1_9_10']/.." position="attributes">
<attribute name="invisible">1</attribute>
</xpath>
<xpath expr="//field[@name='sel_groups_1_9_10']/.." position="after">
<group col="2">
<group string="User Type">
<field name="sel_groups_1_9_10" string="Type"/>
</group>
<group string="User Access">
<field name="archive_date" string="Archive Date"/>
</group>
</group>
</xpath>
</data></field>
</record>
更新:
我在远程服务器上收到此错误,但现在我刚刚收到它。但是我收到的错误消息提供了更多详细信息,尤其是。值得注意的是,该视图确实存在,但由于某种原因 odoo 说它不存在。
raise ValueError(formatted_message).with_traceback(from_traceback) from from_exception
odoo.exceptions.ValidationError: Error while validating view:
Element '<xpath expr="//field[@name='sel_groups_1_9_10']/..">' cannot be located in parent view
View name: res.users.form.inherit
Error context:
view: ir.ui.view(436,)
xmlid: view_users_form
view.model: res.users
view.parent: ir.ui.view(154,)
file: /odoo/odoo14/custom_addons/custom_module/views/views.xml
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)