Sale XML-RPC Compatible

Make sale orders compatible with XML-RPC

14.0

https://hub.konvergo.app/web/image/product.template/1363/image_1920?unique=d7bc9c3
  • Odoo Version

Description

Sale XML-RPC Compatible

Context

Odoo uses XML-RPC as solution to expose its API.

It exposes all object methods that are not prefixed with a underscore.

However, when a method returns None, it fails to properly create the HTTP response and the request end up in error.

In such case, you end up with a stack trace such as:

[ERROR] XmlRpcFaultException : Server returned a fault exception: [1] Traceback (most recent call last):

File "/home/odoo/src/odoo/odoo/addons/base/controllers/rpc.py", line 88, in xmlrpc_2
response = self._xmlrpc(service)
File "/home/odoo/src/odoo/odoo/addons/base/controllers/rpc.py", line 69, in _xmlrpc
return dumps((result,), methodresponse=1, allow_none=False)
File "/usr/lib/python3.8/xmlrpc/client.py", line 968, in dumps
data = m.dumps(params)
File "/usr/lib/python3.8/xmlrpc/client.py", line 501, in dumps
dump(v, write)
File "/usr/lib/python3.8/xmlrpc/client.py", line 523, in __dump
f(self, value, write)
File "/usr/lib/python3.8/xmlrpc/client.py", line 527, in dump_nil
raise TypeError("cannot marshal None unless allow_none is enabled")

TypeError: cannot marshal None unless allow_none is enabled

Overview

This module modifies the method update_prices on sale.order to return True instead of None.

Therefore, the method can be called with xmlrpc.

Contributors


License
Technical Name
Log In to view
Version
14.0