Odoo Help


Need to know how to find value of Database name?

Atchuthan - Technical Consultant, Sodexis Inc
on 10/8/13, 2:50 AM 2,381 views

Hi friendz,

I need to show a field 'db_name' using function field.

def db_name_get(......)

provide me the process or how to get value of database name.

Thanks & Regards,



IBS Group

--IBS Group--
| 4 6 8
Tetouan, Morocco
--IBS Group--

For more informations about IBS, please visit our website at www.ibs-na.com.

For a specific questions, collaboration or help, please send us an email to support@ibs-na.com

IBS Group
On 10/8/13, 2:23 PM
def db_name_get( self, cr, uid, ids, field_name, arg, context ):
    return_value = {}

    for record in self.browse( cr, uid, ids, context ):
        return_value[ record.id ] = cr.dbname

    return return_value

Add the function name to the declaration of your functional field.


Another solution:

from openerp.http import request
def db_name_get(......)
dbname = request.session['db']
return dbname
On 10/8/13, 7:07 AM
def get_dbname():
    dbname = self.pool.db.dbname
    return dbname

About This Community

This platform 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.


Odoo Training Center

Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.

Test it now

Question tools

0 follower(s)


Asked: 10/8/13, 2:50 AM
Seen: 2381 times
Last updated: 2/20/17, 6:06 AM