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.

1

How to fetch current logged in database name

By
Nirav Bhadradiya
on 3/13/13, 10:15 AM 1,820 views

How to fetch current logged in database name at server side in particular class??

3
Allison
On 3/13/13, 11:19 AM

The database cursor should have it. Try:

cr.dbname

but for that i have to inherit osv and the place(http_server.py) where i need dbname is already implemented class and used in many classes,,,so if i am trying to inherit osv.osv then it gives me::TypeError: Error when calling the metaclass bases

Nirav Bhadradiya
on 3/14/13, 1:58 AM

Could you edit your post to include more context? Paste some code and such.

Allison
on 3/14/13, 9:56 AM

Hello Allison,,thank you so much for your reply but i have done what i want, i have fetched db_name from tools.config['db_name']....Thanxxx

Nirav Bhadradiya
on 3/14/13, 10:01 AM

Hello Nirav, I use db_name=tools.config['db_name'] but the return value is False. could you please tell me how?

voathnak lim
on 7/21/13, 11:40 PM

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: 3/13/13, 10:15 AM
Seen: 1820 times
Last updated: 3/16/15, 8:10 AM