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

Need to know how to find value of Database name?

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

IBS

--IBS--
1302
| 4 5 8
Tétouan, Morocco
--IBS--

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
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
herbert6453
On 10/8/13, 7:07 AM
def get_dbname():
    dbname = self.pool.db.dbname
    return dbname

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

0 follower(s)

Stats

Asked: 10/8/13, 2:50 AM
Seen: 1415 times
Last updated: 3/31/15, 5:36 PM