Odoo Help

0

How to get the name of the database by code?

By
Michael Marroquin
on 10/18/16, 9:05 PM 299 views

My question is how can I get the name of the database, where I am accessing, by python code.

1
Yenthe
On 10/19/16, 1:56 AM

Hi Michael,

You can actually get the data from the Odoo cursor. New API:

db_name = self._cr.dbname

Old API:

db_name = cr.dbname

db_name will then contain the name of your database.

Regards,
Yenthe

About This Community

This platform is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.

Register

Odoo Training Center

Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.

Test it now

Question tools

1 follower(s)

Stats

Asked: 10/18/16, 9:05 PM
Seen: 299 times
Last updated: 10/19/16, 10:12 AM