Odoo Help


fields.selection and name_get

on 7/25/13, 8:34 AM 1,450 views

Hi everyone, I have some problem in use fuknction name_get where i have fields. selection.

I have this:

class produkt_rodzaj(osv.osv):
    _columns= {
        'name': fields.selection([('1','Carlsberg'),('2','Heineken'),('3','Miller')], 'Nazwa', required=True),
        'wielkosc': fields.selection([('1','Male'),('2','Duze')], 'Wielkosc', required=True),
        'rodzaj': fields.selection([('1','Bezalkoholowe'),('2', 'Alk. 2%'), ('3','Alk. 5%')],'Rodzaj piwa', required=True),
        'cena': fields.float('Cena', size=12),

and i want display name product like 'Carlsberg'. Now i see only id ;f

my name_get function:

def name_get(self, cr, uid, ids, context=None):
        res = []
        for produkt_obj in self.browse(cr, uid, ids, context=context):
            name = produkt_obj.name.name
            res.append((produkt_obj.id, name))
        return res

Anyone can help me?

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