Passa al contenuto
Menu
È necessario essere registrati per interagire con la community.
La domanda è stata contrassegnata
1 Rispondi
6479 Visualizzazioni

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

Avatar
Abbandona
Risposta migliore

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
Abbandona