Odoo Help

Welcome!

This community is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.

0

How to get the name of the database by code?

By
Michael Marroquin
on 10/18/16, 9:05 PM 95 views

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

1

Yenthe

--Yenthe--
6716
| 7 7 8
Turnhout, Belgium
--Yenthe--

My Odoo blog: http://www.odoo.yenthevg.com/

My Twitter: https://twitter.com/Yenthe666

Yenthe
On 10/19/16, 1:56 AM

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

Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

About This Community

This community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

1 follower(s)

Stats

Asked: 10/18/16, 9:05 PM
Seen: 95 times
Last updated: 10/19/16, 10:12 AM