Login to your new database¶

Use the login method on a database with the account of your choice:

>>> odoo.login('tutorial', 'admin', 'password')


Under the hood the login method creates a cookie, and all requests thereafter which need a user authentication are cookie-based.

Once logged in, you can check some information through the environment:

>>> odoo.env.db
>>> odoo.env.context
{'lang': 'fr_FR', 'tz': 'Europe/Brussels', 'uid': 1}
>>> odoo.env.uid
>>> odoo.env.lang
>>> odoo.env.user.name              # name of the user
>>> odoo.env.user.company_id.name   # the name of its company

From now, you can easily execute any kind of queries on your Odoo server (execute model methods, trigger workflow, download reports...).

Next step: Execute RPC queries