简体   繁体   中英

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

ValueError: Invalid field 'recaptcha_public_key' on model 'res.config.settings'

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 .

在此处输入图像描述

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.

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)
  • In the file __init__.py of your module, you don't import your folder models (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.
  • 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)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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