1

当我进入用户设置时,出现以下错误:

模型“res.config.settings”上的字段“documents_account_settings”无效

我一直在查看基本代码,似乎字段documents_account_settings不再在模型中,我一直在查看的文件是/home/odoo/src/odoo/addons/account/models/res_config_settings。 py

有没有与此相关的已知错误?

这是完整的跟踪如下:

Odoo Server Error
Traceback (most recent call last):
  File "/home/odoo/src/odoo/odoo/addons/base/models/ir_http.py", line 237, in _dispatch
    result = request.dispatch()
  File "/home/odoo/src/odoo/odoo/http.py", line 683, in dispatch
    result = self._call_function(**self.params)
  File "/home/odoo/src/odoo/odoo/http.py", line 359, in _call_function
    return checked_call(self.db, *args, **kwargs)
  File "/home/odoo/src/odoo/odoo/service/model.py", line 94, in wrapper
    return f(dbname, *args, **kwargs)
  File "/home/odoo/src/odoo/odoo/http.py", line 347, in checked_call
    result = self.endpoint(*a, **kw)
  File "/home/odoo/src/odoo/odoo/http.py", line 912, in __call__
    return self.method(*args, **kw)
  File "/home/odoo/src/odoo/odoo/http.py", line 531, in response_wrap
    response = f(*args, **kw)
  File "/home/odoo/src/odoo/addons/web/controllers/main.py", line 1377, in call_kw
    return self._call_kw(model, method, args, kwargs)
  File "/home/odoo/src/odoo/addons/web/controllers/main.py", line 1369, in _call_kw
    return call_kw(request.env[model], method, args, kwargs)
  File "/home/odoo/src/odoo/odoo/api.py", line 394, in call_kw
    result = _call_kw_model_create(method, model, args, kwargs)
  File "/home/odoo/src/odoo/odoo/api.py", line 374, in _call_kw_model_create
    result = method(recs, *args, **kwargs)
  File "<decorator-gen-188>", line 2, in create
  File "/home/odoo/src/odoo/odoo/api.py", line 323, in _model_create_single
    return create(self, arg)
  File "/home/odoo/src/odoo/addons/account/models/res_config_settings.py", line 176, in create
    return super(ResConfigSettings, self).create(values)
  File "<decorator-gen-64>", line 2, in create
  File "/home/odoo/src/odoo/odoo/api.py", line 344, in _model_create_multi
    return create(self, [arg])
  File "/home/odoo/src/odoo/odoo/addons/base/models/ir_fields.py", line 533, in create
    recs = super().create(vals_list)
  File "<decorator-gen-13>", line 2, in create
  File "/home/odoo/src/odoo/odoo/api.py", line 345, in _model_create_multi
    return create(self, arg)
  File "/home/odoo/src/odoo/odoo/models.py", line 3818, in create
    raise ValueError("Invalid field %r on model %r" % (key, self._name))
Exception

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/home/odoo/src/odoo/odoo/http.py", line 639, in _handle_exception
    return super(JsonRequest, self)._handle_exception(exception)
  File "/home/odoo/src/odoo/odoo/http.py", line 315, in _handle_exception
    raise exception.with_traceback(None) from new_cause
ValueError: Invalid field 'documents_account_settings' on model 'res.config.settings'
4

2 回答 2

1

通常,当我们(开发人员)需要管理员输入的内容时,我们会在其中创建一个字段res.config.settings来获取它,因此如果您在 module 中查找它account,您可能永远看不到它,它是由另一个模块创建的。此错误是由于未安装正确的模块或更多指定导致您打开一个视图,其中显示此字段 ( documents_account_settings) 但您的数据库中没有该字段。

在这种情况下,您可以做两件事(我知道)以使其变得更好:

  • 在源代码中找到此字段的创建位置,并更新或安装该模块,或者更简单(对于 Odoo 用户)更新模块base,它可能会重置数据库中的问题模块。
  • 如果您是开发人员(如果为真,我更喜欢),您可以转到您的数据库 table ir_ui_view,找到哪个视图创建了该问题(继承名为 'res.config.settings.view.form' 的视图),然后更改架构部分其中。

希望这对您有所帮助,因为我只能向您展示归档目标的方式,不能为您完成。

于 2021-01-08T04:18:57.400 回答
1

确保您已经安装了应用程序documents_account,它将被初始化。

于 2021-01-08T05:48:42.363 回答