تخطي للذهاب إلى المحتوى
القائمة
لقد تم الإبلاغ عن هذا السؤال
1 الرد
6475 أدوات العرض

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

الصورة الرمزية
إهمال