简体   繁体   English

尝试在 Odoo 14 中保存常规选项时出错

[英]Error when trying to save general options in Odoo 14

When I try to save any config I'm getting the following error:当我尝试保存任何配置时,我收到以下错误:

Error: Odoo Server Error错误:Odoo 服务器错误

ValueError: Invalid field 'recaptcha_public_key' on model 'res.config.settings' ValueError:model 'res.config.settings' 上的无效字段 'recaptcha_public_key'

The complete trace is the following:完整的跟踪如下:

    Odoo Server Error
Traceback (most recent call last):
  File "C:\Program Files\Odoo 14.0.20210511\server\odoo\addons\base\models\ir_http.py", line 237, in _dispatch
    result = request.dispatch()
  File "C:\Program Files\Odoo 14.0.20210511\server\odoo\http.py", line 683, in dispatch
    result = self._call_function(**self.params)
  File "C:\Program Files\Odoo 14.0.20210511\server\odoo\http.py", line 359, in _call_function
    return checked_call(self.db, *args, **kwargs)
  File "C:\Program Files\Odoo 14.0.20210511\server\odoo\service\model.py", line 94, in wrapper
    return f(dbname, *args, **kwargs)
  File "C:\Program Files\Odoo 14.0.20210511\server\odoo\http.py", line 347, in checked_call
    result = self.endpoint(*a, **kw)
  File "C:\Program Files\Odoo 14.0.20210511\server\odoo\http.py", line 912, in __call__
    return self.method(*args, **kw)
  File "C:\Program Files\Odoo 14.0.20210511\server\odoo\http.py", line 531, in response_wrap
    response = f(*args, **kw)
  File "C:\Program Files\Odoo 14.0.20210511\server\odoo\addons\web\controllers\main.py", line 1389, in call_kw
    return self._call_kw(model, method, args, kwargs)
  File "C:\Program Files\Odoo 14.0.20210511\server\odoo\addons\web\controllers\main.py", line 1381, in _call_kw
    return call_kw(request.env[model], method, args, kwargs)
  File "C:\Program Files\Odoo 14.0.20210511\server\odoo\api.py", line 394, in call_kw
    result = _call_kw_model_create(method, model, args, kwargs)
  File "C:\Program Files\Odoo 14.0.20210511\server\odoo\api.py", line 374, in _call_kw_model_create
    result = method(recs, *args, **kwargs)
  File "<decorator-gen-96>", line 2, in create
  File "C:\Program Files\Odoo 14.0.20210511\server\odoo\api.py", line 323, in _model_create_single
    return create(self, arg)
  File "C:\Program Files\Odoo 14.0.20210511\server\odoo\addons\base\models\res_config.py", line 783, in create
    return super(ResConfigSettings, self).create(values)
  File "<decorator-gen-65>", line 2, in create
  File "C:\Program Files\Odoo 14.0.20210511\server\odoo\api.py", line 344, in _model_create_multi
    return create(self, [arg])
  File "C:\Program Files\Odoo 14.0.20210511\server\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 "C:\Program Files\Odoo 14.0.20210511\server\odoo\api.py", line 345, in _model_create_multi
    return create(self, arg)
  File "C:\Program Files\Odoo 14.0.20210511\server\odoo\models.py", line 3825, 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 "C:\Program Files\Odoo 14.0.20210511\server\odoo\http.py", line 639, in _handle_exception
    return super(JsonRequest, self)._handle_exception(exception)
  File "C:\Program Files\Odoo 14.0.20210511\server\odoo\http.py", line 315, in _handle_exception
    raise exception.with_traceback(None) from new_cause
ValueError: Invalid field 'recaptcha_public_key' on model 'res.config.settings'

Answer here, that's because some module was missing.在这里回答,那是因为缺少某些模块。 search odoo source code with recaptcha_public_key we can see the module name is google_recaptcha .使用recaptcha_public_key搜索 odoo 源代码,我们可以看到模块名称是google_recaptcha

在此处输入图像描述

In your system open Apps page, search that module and install will resolve your problem.在您的系统打开应用程序页面中,搜索该模块并安装将解决您的问题。 Or you can install it by command line bellow (need restart server after that):或者您可以通过下面的命令行安装它(之后需要重新启动服务器):

./odoo-bin -d <yourdbname> -i google_recaptcha

在此处输入图像描述

This message is simply because you try create a record and in the values passed to create it a field is filled in but isn't present in the model.此消息仅仅是因为您尝试创建一条记录,并且在传递的值中创建它一个字段已填写,但在 model 中不存在。

But with only this error log.但只有这个错误日志。 I can't more help you.我不能再帮你了。

Possible error:可能的错误:

  • In the file __init__.py of your folder models you don't import your file (Example: from. import config)在文件夹模型的文件__init__.py中,您不导入文件(例如:from.import config)
  • In the file __init__.py of your module, you don't import your folder models (from. import models)在模块的文件__init__.py中,不要导入文件夹模型(from.import models)
  • Missing a dependence, file with this field could be in module 1 and you try to create record with this field in module 2, but no depend exist between module 1 and 2.缺少依赖项,具有此字段的文件可能位于模块 1 中,您尝试在模块 2 中使用此字段创建记录,但模块 1 和模块 2 之间不存在依赖项。
  • Problem this creation of the field.质疑这个领域的创造。
  • Bad updating of module.模块更新错误。 You add the field but the don't update module.您添加了字段但不更新模块。 (-u your_module OR with the interface) (-u your_module 或与接口)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM