oerplib.service.common¶
-
class
oerplib.service.common.
Common
(oerp)¶ New in version 0.6.
The Common class represents the
/common
RPC service which lets you log in on the server, and provides various utility functions.Note
This service have to be used through the
oerplib.OERP.common
property.>>> import oerplib >>> oerp = oerplib.OERP('localhost') >>> oerp.common <oerplib.service.common.Common object at 0xb76266ac>
Warning
All methods documented below are not strictly implemented in OERPLib
Method calls are purely dynamic, and the following documentation can be wrong if the API of the server is changed between versions. Anyway, if you know the API proposed by the server for the
/common
RPC service, it will work.-
login
(db, login, password)¶ >>> oerp.common.login('test_db', 'admin', 'admin_passwd') 1
Returns: the user’s ID or False
-
authenticate
(db, login, password, user_agent_env)¶ >>> oerp.common.authenticate('test_db', 'admin', 'admin_passwd', {}) 1
Returns: the user’s ID or False
-
version
()¶ >>> oerp.common.version() {'protocol_version': 1, 'server_version': '6.1'}
-
about
(extended=False)¶ Return information about the server.
>>> oerp.common.about() 'See http://openerp.com'
>>> oerp.common.about(True) ['See http://openerp.com', '8.0alpha1']
Param: extended: if True then return version info Returns: string if extended is False else tuple
-
timezone_get
(db, login, password)¶ >>> oerp.common.timezone_get('test_db', 'admin', 'admin_passwd') 'UTC'
-
get_server_environment
()¶ >>> print(oerp.common.get_server_environment()) Environment Information : System : Linux-2.6.32-5-686-i686-with-debian-6.0.4 OS Name : posix Distributor ID: Debian Description: Debian GNU/Linux 6.0.4 (squeeze) Release: 6.0.4 Codename: squeeze Operating System Release : 2.6.32-5-686 Operating System Version : #1 SMP Mon Mar 26 05:20:33 UTC 2012 Operating System Architecture : 32bit Operating System Locale : fr_FR.UTF8 Python Version : 2.6.6 OpenERP-Server Version : 5.0.16 Last revision No. & ID :
-
login_message
()¶ >>> oerp.common.login_message() 'Welcome'
-
set_loglevel
(loglevel, logger=None)¶ >>> oerp.common.set_loglevel('DEBUG')
-
get_stats
()¶ >>> print(oerp.common.get_stats()) OpenERP server: 5 threads Servers started Net-RPC: running
-
list_http_services
()¶ >>> oerp.common.list_http_services() []
-
check_connectivity
()¶ >>> oerp.common.check_connectivity() True
-
get_os_time
()¶ >>> oerp.common.get_os_time() (0.01, 0.0, 0.0, 0.0, 17873633.129999999)
-
get_sqlcount
()¶ >>> oerp.common.get_sqlcount()
-
get_available_updates
(super_admin_password, contract_id, contract_password)¶ >>> oerp.common.get_available_updates('super_admin_passwd', 'MY_CONTRACT_ID', 'MY_CONTRACT_PASSWORD')
-
get_migration_scripts
(super_admin_password, contract_id, contract_password)¶ >>> oerp.common.get_migration_scripts('super_admin_passwd', 'MY_CONTRACT_ID', 'MY_CONTRACT_PASSWORD')
-