Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[XmlRcp] TypeError: cannot marshal <class 'collections.defaultdict'> objects (account.move -> tax_totals) #129494

Closed
Prometee opened this issue Jul 24, 2023 · 1 comment

Comments

@Prometee
Copy link

Prometee commented Jul 24, 2023

Impacted versions: 16

Steps to reproduce:

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

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

Make an XMLRPC call "search_read" on the model account.move requesting all fields except needed_terms (see #129493).

Current behavior:

Traceback (most recent call last):
  File "/usr/lib/python3.9/xmlrpc/client.py", line 516, in __dump
    f = self.dispatch[type(value)]
KeyError: <class 'collections.defaultdict'>

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/odoo/addons/base/controllers/rpc.py", line 148, in xmlrpc_2
    except Exception as error:
  File "/usr/lib/python3/dist-packages/odoo/addons/base/controllers/rpc.py", line 129, in _xmlrpc
  File "/usr/lib/python3.9/xmlrpc/client.py", line 975, in dumps
    data = m.dumps(params)
  File "/usr/lib/python3.9/xmlrpc/client.py", line 508, in dumps
    dump(v, write)
  File "/usr/lib/python3.9/xmlrpc/client.py", line 530, in __dump
    f(self, value, write)
  File "/usr/lib/python3.9/xmlrpc/client.py", line 583, in dump_array
    dump(v, write)
  File "/usr/lib/python3.9/xmlrpc/client.py", line 530, in __dump
    f(self, value, write)
  File "/usr/lib/python3.9/xmlrpc/client.py", line 601, in dump_struct
    dump(v, write)
  File "/usr/lib/python3.9/xmlrpc/client.py", line 530, in __dump
    f(self, value, write)
  File "/usr/lib/python3.9/xmlrpc/client.py", line 601, in dump_struct
    dump(v, write)
  File "/usr/lib/python3.9/xmlrpc/client.py", line 520, in __dump
    raise TypeError("cannot marshal %s objects" % type(value))
TypeError: cannot marshal <class 'collections.defaultdict'> objects

Expected behavior: No error

The field causing this error is tax_totals

@Prometee Prometee changed the title [XmlRcp] TypeError: cannot marshal <class 'collections.defaultdict'> objects [XmlRcp] TypeError: cannot marshal <class 'collections.defaultdict'> objects (account.move -> tax_totals) Jul 24, 2023
@niyasraphy
Copy link
Contributor

fixed in: cc61b92

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants