RPC#

class trytond.rpc.RPC([readonly[, instantiate[[, decorator, result[, check_access[, unique[, fresh_session[, cache]]]]]]]])#

Define the behavior of Remote Procedure Call.

Instance attributes are:

RPC.readonly#

The transaction mode

RPC.instantiate#

The position or the slice of the argument to be instanciated

RPC.decorator#

The function to decorate the called procedure with

RPC.result#

The function to transform the result

RPC.check_access#

Set _check_access in the context to activate the access right on model and field. Default is True.

RPC.unique#

If set, it ensures the instantiated records are unique. Default is True.

RPC.fresh_session#

If set, it requires a fresh session. Default is False.

RPC.cache#

A RPCCache instance to compute the cache duration for the answer.

RPCCache#

class trytond.rpc.RPCCache([days[, seconds])#

Define cache duration of RPC result.

Instance attributes are:

RPC.duration#

A datetime.timedelta instance.

Instance methods are:

RCP.headers()#

Return a dictionary of the headers.

Exceptions#

exception trytond.rpc.RPCReturnException#

The base class of exceptions to return the result of result method instead of raising an exception.

The Transaction is rollbacked and tasks are cleared.