Přejít na obsah
Menu
You need to be registered to interact with the community.
This question has been flagged
1 Odpovědět
6280 Zobrazení

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

Avatar
Zrušit
Nejlepší odpověď

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

Avatar
Zrušit