尝试在 odoo 14 中列出用户时出错

Error when trying to list users in odoo 14

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

Invalid field 'documents_account_settings' on model 'res.config.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'

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

在这种情况下,您可以做两件事(据我所知)以改善情况:

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

希望你觉得这对你有帮助,因为我只能告诉你实现目标的方法,不能为你做。

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