connection Package

connection Module


Return connector specified by it’s name


Returns list of connector names registered in system

class odoo_rpc_client.connection.connection.ConnectorBase(host, port, extra_args=None)[source]

Bases: object

Base class for all connectors

  • host (str) – hostname to connect to
  • port (int) – port to connect to
  • extra_args (dict) – extra arguments for specific connector.

Connector extra arguments


Returns service for specified name

Parameters:name – name of service
Returns:specified service instance

Connector host


Connector port


Update extra args and clean service cache

jsonrpc Module

class odoo_rpc_client.connection.jsonrpc.ConnectorJSONRPC(*args, **kwargs)[source]

Bases: odoo_rpc_client.connection.connection.ConnectorBase

JSON-RPC connector

available extra arguments:
  • ssl_verify: (optional) if True, the SSL cert will be verified.
class Meta[source]

Bases: object

name = 'json-rpc'
use_ssl = False
class odoo_rpc_client.connection.jsonrpc.ConnectorJSONRPCS(*args, **kwargs)[source]

Bases: odoo_rpc_client.connection.jsonrpc.ConnectorJSONRPC

JSON-RPCS Connector

class Meta[source]

Bases: object

name = 'json-rpcs'
use_ssl = True
exception odoo_rpc_client.connection.jsonrpc.JSONRPCError(message, code=None, data=None)[source]

Bases: odoo_rpc_client.exceptions.ConnectorError

JSON-RPC error wrapper


Debug information got from Odoo server

Usualy traceback


Error message got from Odoo server

class odoo_rpc_client.connection.jsonrpc.JSONRPCMethod(rpc_proxy, url, service, method)[source]

Bases: object

Class that implements RPC call via json-rpc protocol


Prepare data for JSON request

class odoo_rpc_client.connection.jsonrpc.JSONRPCProxy(host, port, service, ssl=False, ssl_verify=True)[source]

Bases: object

Simple Odoo service proxy wrapper

xmlrpc Module

class odoo_rpc_client.connection.xmlrpc.ConnectorXMLRPC(host, port, extra_args=None)[source]

Bases: odoo_rpc_client.connection.connection.ConnectorBase

XML-RPC connector

Note: extra_arguments may be same as parametrs of xmlrpclib.ServerProxy

class Meta[source]

Bases: object

name = 'xml-rpc'
ssl = False
class odoo_rpc_client.connection.xmlrpc.ConnectorXMLRPCS(host, port, extra_args=None)[source]

Bases: odoo_rpc_client.connection.xmlrpc.ConnectorXMLRPC

XML-RPCS Connector

Note: extra_arguments may be same as parametrs of xmlrpclib.ServerProxy

class Meta[source]

Bases: object

name = 'xml-rpcs'
ssl = True
exception odoo_rpc_client.connection.xmlrpc.XMLRPCError(fault_instance)[source]

Bases: odoo_rpc_client.exceptions.ConnectorError

Exception raised on XMLRpc errors

Parameters:fault_instance (xmlrpclib.Fault) – exception raised by XMLRPC lib

Return xmlrpclib.Fault instance related to this error

class odoo_rpc_client.connection.xmlrpc.XMLRPCMethod(method)[source]

Bases: object

Class wrapper around XML-RPC method to wrap xmlrpclib.Fault into XMLRPCProxy

class odoo_rpc_client.connection.xmlrpc.XMLRPCProxy(uri, transport=None, encoding=None, verbose=False, allow_none=False, use_datetime=False, use_builtin_types=False, *, context=None)[source]

Bases: xmlrpc.client.ServerProxy

Wrapper class around XML-RPC’s ServerProxy to wrap method’s errors into XMLRPCError class

local Module

class odoo_rpc_client.connection.local.ConnectorLocal(*args, **kwargs)[source]

Bases: odoo_rpc_client.connection.connection.ConnectorBase

Connect to local odoo instal.

NOTE: To use this connector, odoo must be importable as ‘odoo’ or
‘openerp’. This connector will automaticaly determine Odoo version, and organize correct bechavior
NOTE2: This connector tested only on python2.7 because
Odoo uses this version of python
NOTE3: Because, standard params have no sense for this connector,
it ignores them, but instead, it looks in extra_args for argument ‘local_args’, which must be a list of command_line args to run odoo with
NOTE4: This connector still in alpha stage, so it may introduce some
class Meta[source]

Bases: object

name = 'local'
exception odoo_rpc_client.connection.local.LocalConnectorError(exc)[source]

Bases: odoo_rpc_client.exceptions.ConnectorError

Local connector error wrapper

class odoo_rpc_client.connection.local.LocalMethod(service, name)[source]

Bases: object

Odoo method wrapper

class odoo_rpc_client.connection.local.LocalService(connection, service_name)[source]

Bases: object

Local Odoo service