odoorpc.tools

This module contains the Config class which manage the configuration related to an instance of ODOO, and some useful helper functions used internally in OdooRPC.

class odoorpc.tools.Config(odoo, options)

Class which manage the configuration of an ODOO instance.

Note

This class have to be used through the odoorpc.ODOO.config property.

>>> import odoorpc
>>> odoo = odoorpc.ODOO('localhost')    
>>> type(odoo.config)
<class 'odoorpc.tools.Config'>
odoorpc.tools.clean_version(version)

Clean a version string.

>>> from odoorpc.tools import clean_version
>>> clean_version('7.0alpha-20121206-000102')
'7.0'
Returns:a cleaner version string
odoorpc.tools.v(version)

Convert a version string to a tuple. The tuple can be use to compare versions between them.

>>> from odoorpc.tools import v
>>> v('7.0')
[7, 0]
>>> v('6.1')
[6, 1]
>>> v('7.0') < v('6.1')
False
Returns:the version as tuple