odoo / odoo

Odoo. Open Source Apps To Grow Your Business.
https://www.odoo.com
Other
37.88k stars 24.6k forks source link

[JsonRcp] TypeError: keys must be str, int, float, bool or None, not frozendict #164139

Open Prometee opened 5 months ago

Prometee commented 5 months ago

Impacted versions: 17

Steps to reproduce:

Use Odoo Docker official image and run it with this options :

docker run -p 8069:8069 --env HOST=host.docker.internal --name odoo_17 --pull missing -t odoo:17 -- --database odoo-master-v17 --init "l10n_fr,account_accountant,sale_management"

Make an JSON-RPC call "search_read" on the model account.move.line requesting all fields.

Current behavior:

Odoo Server Error - builtins.TypeError
Traceback (most recent call last):
  File "/home/odoo/src/odoo/odoo/http.py", line 1768, in _serve_db
    return service_model.retrying(self._serve_ir_http, self.env)
  File "/home/odoo/src/odoo/odoo/service/model.py", line 133, in retrying
    result = func()
  File "/home/odoo/src/odoo/odoo/http.py", line 1795, in _serve_ir_http
    response = self.dispatcher.dispatch(rule.endpoint, args)
  File "/home/odoo/src/odoo/odoo/http.py", line 2002, in dispatch
    return self._response(result)
  File "/home/odoo/src/odoo/odoo/http.py", line 2038, in _response
    return self.request.make_json_response(response)
  File "/home/odoo/src/odoo/odoo/http.py", line 1622, in make_json_response
    data = json.dumps(data, ensure_ascii=False, default=date_utils.json_default)
  File "/usr/lib/python3.10/json/__init__.py", line 238, in dumps
    **kw).encode(obj)
  File "/usr/lib/python3.10/json/encoder.py", line 199, in encode
    chunks = self.iterencode(o, _one_shot=True)
  File "/usr/lib/python3.10/json/encoder.py", line 257, in iterencode
    return _iterencode(o, 0)
TypeError: keys must be str, int, float, bool or None, not frozendict

Expected behavior: No error

The field causing this error is compute_all_tax

Caryntjen commented 4 months ago

I also got a similar issue, the same on read as on searchRead

File "/home/odoo/src/odoo/saas-17.2/odoo/addons/base/controllers/rpc.py", line 156, in xmlrpc_2
    response = self._xmlrpc(service)
  File "/home/odoo/src/custom/trial/saas_trial/controllers/main.py", line 307, in _xmlrpc
    res = super(OdooRPC, self)._xmlrpc(service)
  File "/home/odoo/src/odoo/saas-17.2/odoo/addons/base/controllers/rpc.py", line 135, in _xmlrpc
    return xmlrpc.client.dumps((result,), methodresponse=1, allow_none=False)
  File "/usr/lib/python3.10/xmlrpc/client.py", line 981, in dumps
    data = m.dumps(params)
  File "/usr/lib/python3.10/xmlrpc/client.py", line 514, in dumps
    dump(v, write)
  File "/usr/lib/python3.10/xmlrpc/client.py", line 536, in __dump
    f(self, value, write)
  File "/usr/lib/python3.10/xmlrpc/client.py", line 589, in dump_array
    dump(v, write)
  File "/usr/lib/python3.10/xmlrpc/client.py", line 536, in __dump
    f(self, value, write)
  File "/usr/lib/python3.10/xmlrpc/client.py", line 607, in dump_struct
    dump(v, write)
  File "/usr/lib/python3.10/xmlrpc/client.py", line 536, in __dump
    f(self, value, write)
  File "/usr/lib/python3.10/xmlrpc/client.py", line 605, in dump_struct
    raise TypeError("dictionary key must be string")
TypeError: dictionary key must be string
Caryntjen commented 4 months ago

@vava-odoo any progress on the issue?

Gitdyr commented 3 months ago

I also see this when I "read" from "account.move.line" (I access the API from PHP). A can read all fields in the row except compute_all_tax.

much-kareem commented 2 weeks ago

We are facing the same issue, any news?

Prometee commented 2 weeks ago

@niyasraphy are you able to handle this issue, or report it to someone who can ?