- 手上的问题 -
我在FreeNAS 9.10.2服务器上的BSD监狱中运行Odoo 10.0。尝试安装POS应用程序时,我收到带有以下回溯报告的Odoo服务器错误:
Traceback (most recent call last):
File "/usr/local/odoo/odoo/http.py", line 638, in _handle_exception
return super(JsonRequest, self)._handle_exception(exception)
File "/usr/local/odoo/odoo/http.py", line 675, in dispatch
result = self._call_function(**self.params)
File "/usr/local/odoo/odoo/http.py", line 331, in _call_function
return checked_call(self.db, *args, **kwargs)
File "/usr/local/odoo/odoo/service/model.py", line 119, in wrapper
return f(dbname, *args, **kwargs)
File "/usr/local/odoo/odoo/http.py", line 324, in checked_call
result = self.endpoint(*a, **kw)
File "/usr/local/odoo/odoo/http.py", line 933, in __call__
return self.method(*args, **kw)
File "/usr/local/odoo/odoo/http.py", line 504, in response_wrap
response = f(*args, **kw)
File "/usr/local/odoo/addons/web/controllers/main.py", line 866, in call_button
action = self._call_kw(model, method, args, {})
File "/usr/local/odoo/addons/web/controllers/main.py", line 854, in _call_kw
return call_kw(request.env[model], method, args, kwargs)
File "/usr/local/odoo/odoo/api.py", line 681, in call_kw
return call_kw_multi(method, model, args, kwargs)
File "/usr/local/odoo/odoo/api.py", line 672, in call_kw_multi
result = method(recs, *args, **kwargs)
File "/usr/local/odoo/odoo/addons/base/module/module.py", line 410, in button_immediate_install
return self._button_immediate_function(type(self).button_install)
File "/usr/local/odoo/odoo/addons/base/module/module.py", line 484, in _button_immediate_function
modules.registry.Registry.new(self._cr.dbname, update_module=True)
File "/usr/local/odoo/odoo/modules/registry.py", line 78, in new
odoo.modules.load_modules(registry._db, force_demo, status, update_module)
File "/usr/local/odoo/odoo/modules/loading.py", line 337, in load_modules
loaded_modules, update_module)
File "/usr/local/odoo/odoo/modules/loading.py", line 235, in load_marked_modules
loaded, processed = load_module_graph(cr, graph, progressdict, report=report, skip_modules=loaded_modules, perform_checks=perform_checks)
File "/usr/local/odoo/odoo/modules/loading.py", line 156, in load_module_graph
_load_data(cr, module_name, idref, mode, kind='data')
File "/usr/local/odoo/odoo/modules/loading.py", line 95, in _load_data
tools.convert_file(cr, module_name, filename, idref, mode, noupdate, kind, report)
File "/usr/local/odoo/odoo/tools/convert.py", line 848, in convert_file
convert_xml_import(cr, module, fp, idref, mode, noupdate, report)
File "/usr/local/odoo/odoo/tools/convert.py", line 918, in convert_xml_import
obj.parse(doc.getroot(), mode=mode)
File "/usr/local/odoo/odoo/tools/convert.py", line 799, in parse
self.parse(rec, mode)
File "/usr/local/odoo/odoo/tools/convert.py", line 802, in parse
self._tags[rec.tag](rec, de, mode=mode)
File "/usr/local/odoo/odoo/tools/convert.py", line 710, in _tag_record
id = self.env(context=rec_context)['ir.model.data']._update(rec_model, self.module, res, rec_id or False, not self.isnoupdate(data_node), noupdate=self.isnoupdate(data_node), mode=self.mode)
File "/usr/local/odoo/odoo/addons/base/ir/ir_model.py", line 1186, in _update
record = record.create(values)
File "/usr/local/odoo/odoo/addons/base/ir/ir_ui_view.py", line 353, in create
return super(View, self).create(self._compute_defaults(values))
File "/usr/local/odoo/odoo/models.py", line 3817, in create
self._fields[key].determine_inverse(record)
File "/usr/local/odoo/odoo/fields.py", line 999, in determine_inverse
getattr(records, self.inverse)()
File "/usr/local/odoo/odoo/addons/base/ir/ir_ui_view.py", line 220, in _inverse_arch
view.write(data)
File "/usr/local/odoo/odoo/addons/base/ir/ir_ui_view.py", line 371, in write
return super(View, self).write(self._compute_defaults(vals))
File "/usr/local/odoo/odoo/models.py", line 3549, in write
self._write(old_vals)
File "/usr/local/odoo/odoo/models.py", line 3695, in _write
self._validate_fields(vals)
File "/usr/local/odoo/odoo/models.py", line 1073, in _validate_fields
raise ValidationError("%s\n\n%s" % (_("Error while validating constraint"), tools.ustr(e)))
ParseError: "Error while validating constraint
Element '<xpath expr="//group[@name='inventory']//field[@name='categ_id']">' cannot be located in parent view
Error context:
View `product.normal.form`
[view_id: 1140, xml_id: n/a, model: product.template, parent_id: 298]
None" while parsing /usr/local/odoo/addons/product_multi_category/views/product_view.xml:4, near
<record id="product_normal_form_view_add_categids" model="ir.ui.view">
<field name="name">product.normal.form</field>
<field name="model">product.template</field>
<field name="inherit_id" ref="product.product_template_form_view"/>
<field eval="7" name="priority"/>
<field name="arch" type="xml">
<xpath expr="//group[@name='inventory']//field[@name='categ_id']" position="after">
<field name="categ_ids" widget="many2many_tags"/>
</xpath>
</field>
</record>
- 我的评估 -
然而,引起我注意的是接近尾迹的结尾;一个ParseError
。在ParseError
的细节中,它正在解析的元素在它正在解析的文件中有一个额外的属性。也就是说,它正在解析<xpath expr="...'categ_id']">'
,但正在解析的文件包含<xpath expr="...'categ_id']" position="after">
?
- 采取措施 -
我在尝试再次安装POS应用之前,通过从position="after"
表达式中删除xpath
属性来编辑有问题的xml文件。不幸的是,结果是一样的。
- 下一步 -
我可以采取哪些其他措施来解决这种情况?
- 编辑#1 - 采取进一步措施 - 我尝试在同一个Odoo服务器上托管的另一个数据库上安装该应用程序,并且安装时该数据库没有任何问题。尝试在我尝试的第一个数据库上安装POS应用程序时,我仍遇到服务器错误。
- 编辑#2 - 成功! - 我采取的步骤通过评论者的有用提示解决了这个问题。
成功!
我仍然不确定是什么原因引起了这个问题。即使恢复旧备份也不允许我安装POS模块或任何模块。然而,现在;我可以。