跳至內容
選單
此問題已被標幟
1 回覆
6490 瀏覽次數

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

頭像
捨棄
最佳答案

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

頭像
捨棄