Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
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
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},
)
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})
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
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
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
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})
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},
)