Odoo Help

0

Need to know how to find value of Database name?

By
Atchuthan - Technical Consultant, Sodexis Inc
on 10/8/13, 2:50 AM 1,801 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,

Atchuthan

2

odoo.ma by IBS Group

--odoo.ma by IBS Group--
1312
| 4 5 8
Tétouan, Morocco
--odoo.ma by 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

odoo.ma by 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.

0
MouTio
On 2/20/17, 6:06 AM

Another solution:

from openerp.http import request
def db_name_get(......)
dbname = request.session['db']
return dbname
0
herbert6453
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.

Register

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)

Stats

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