How to use the odoorpc.rpc function in OdooRPC

To help you get started, we’ve selected a few OdooRPC examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github OCA / odoorpc / odoorpc / service / wizard.py View on Github external
def rpc_method(*args):
            """Return the result of the RPC request."""
            try:
                meth = getattr(self._oerp._connector.wizard, method, False)
                return meth(self._oerp.database, self._oerp.user.id, *args)
            except rpc.error.ConnectorError as exc:
                raise error.RPCError(exc.message, exc.oerp_traceback)
        return rpc_method
github OCA / odoorpc / odoorpc / odoo.py View on Github external
except (ValueError, TypeError):
            raise ValueError("The timeout must be a float")
        self._host = host
        self._port = port
        self._protocol = protocol
        self._env = None
        self._login = None
        self._password = None
        self._db = DB(self)
        self._report = Report(self)
        # Instanciate the server connector
        try:
            self._connector = rpc.PROTOCOLS[protocol](
                self._host, self._port, timeout, version, opener=opener
            )
        except rpc.error.ConnectorError as exc:
            raise error.InternalError(exc.message)
        # Dictionary of configuration options
        self._config = tools.Config(
            self,
            {'auto_commit': True, 'auto_context': True, 'timeout': timeout},
        )
github osiell / odoorpc / odoorpc / odoo.py View on Github external
timeout = float(timeout)
        except ValueError:
            raise ValueError("The timeout must be a float")
        self._host = host
        self._port = port
        self._protocol = protocol
        self._env = None
        self._login = None
        self._password = None
        self._db = DB(self)
        self._report = Report(self)
        # Instanciate the server connector
        try:
            self._connector = rpc.PROTOCOLS[protocol](
                self._host, self._port, timeout, version)
        except rpc.error.ConnectorError as exc:
            raise error.InternalError(exc.message)
        # Dictionary of configuration options
        self._config = tools.Config(
            self,
            {'auto_commit': True,
             'auto_context': True,
             'timeout': timeout})
github osiell / odoorpc / odoorpc / service / wizard.py View on Github external
def rpc_method(*args):
            """Return the result of the RPC request."""
            try:
                meth = getattr(self._oerp._connector.wizard, method, False)
                return meth(self._oerp.database, self._oerp.user.id, *args)
            except rpc.error.ConnectorError as exc:
                raise error.RPCError(exc.message, exc.oerp_traceback)
        return rpc_method
github osiell / odoorpc / odoorpc / service / common.py View on Github external
def rpc_method(*args):
            """Return the result of the RPC request."""
            try:
                meth = getattr(self._odoo._connector.common, method, False)
                return meth(*args)
            except rpc.error.ConnectorError as exc:
                raise error.RPCError(exc.message, exc.odoo_traceback)
        return rpc_method
github OCA / odoorpc / odoorpc / service / common.py View on Github external
def rpc_method(*args):
            """Return the result of the RPC request."""
            try:
                meth = getattr(self._odoo._connector.common, method, False)
                return meth(*args)
            except rpc.error.ConnectorError as exc:
                raise error.RPCError(exc.message, exc.odoo_traceback)
        return rpc_method
github osiell / odoorpc / odoorpc / odoo.py View on Github external
try:
            if timeout is not None:
                timeout = float(timeout)
        except ValueError:
            raise ValueError("The timeout must be a float")
        self._host = host
        self._port = port
        self._protocol = protocol
        self._env = None
        self._login = None
        self._password = None
        self._db = DB(self)
        self._report = Report(self)
        # Instanciate the server connector
        try:
            self._connector = rpc.PROTOCOLS[protocol](
                self._host, self._port, timeout, version)
        except rpc.error.ConnectorError as exc:
            raise error.InternalError(exc.message)
        # Dictionary of configuration options
        self._config = tools.Config(
            self,
            {'auto_commit': True,
             'auto_context': True,
             'timeout': timeout})
github OCA / odoorpc / odoorpc / odoo.py View on Github external
try:
            if timeout is not None:
                timeout = float(timeout)
        except (ValueError, TypeError):
            raise ValueError("The timeout must be a float")
        self._host = host
        self._port = port
        self._protocol = protocol
        self._env = None
        self._login = None
        self._password = None
        self._db = DB(self)
        self._report = Report(self)
        # Instanciate the server connector
        try:
            self._connector = rpc.PROTOCOLS[protocol](
                self._host, self._port, timeout, version, opener=opener
            )
        except rpc.error.ConnectorError as exc:
            raise error.InternalError(exc.message)
        # Dictionary of configuration options
        self._config = tools.Config(
            self,
            {'auto_commit': True, 'auto_context': True, 'timeout': timeout},
        )