(This message has been automatically imported from the retired mailing list)
Hello,
can anyone familiar with Odoo help me out with this one?
I’m moving the Odoo connector from zato-labs over to the core and one of
the things the connector should have is the ability to ping the already
established connections, just like outgoing HTTP or SQL connections in
Zato can be pinged today.
I’m trying to find a model that is guaranteed to exist in Odoo no matter
the installation and I think the code below should do the trick:
“”"
import openerplib
connection = openerplib.get_connection(hostname=‘localhost’,
database=‘odoo’, login=‘admin’, password=‘admin’)
user_model = connection.get_model(‘res.users’)
ids = user_model.search([(‘login’, ‘=’, ‘admin’)])
user_info = user_model.read(ids[0], [‘login’])
print(user_info[‘login’])
"""
Obviously, ‘admin/admin’ is what users provide in the GUI.
And - given a username and password, if they are correct then we should
have access to res.users as otherwise we would not have logged in at
all. Next, we should be able to search for our own login details in
res.users, again, because we have just been able to make use of that model.
Do you think this is guaranteed to work?
thanks,