Bỏ qua để đến Nội dung
Menu
Câu hỏi này đã bị gắn cờ
1 Trả lời
6485 Lượt xem

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

Ảnh đại diện
Huỷ bỏ
Câu trả lời hay nhất

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

Ảnh đại diện
Huỷ bỏ