Odoo Help

1
Farsin
On 7/17/14, 6:20 AM

try name_get override

0
Moahmed Richi
On 9/4/15, 7:35 AM


_columns = {

'name': fields.function(_combine, type='char',arg=('model1_id.name','model2_id.name'), method=True ,string=" "),

'model1_id':fields.many2one('model1.model1',' '),

'model2_id':fields.many2one('model2.model2',' '),

}

def _combine(self, cr, uid, ids, field_name, args, context=None):

values = {}

for id in ids:

rec = self.browse(cr, uid, [id], context=context)[0]

values[id] = {}

values[id] = '%s -- %s' % (rec.model1_id.name, rec.model2_id.name)

return values

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

1 follower(s)

Stats

Asked: 7/17/14, 5:59 AM
Seen: 1077 times
Last updated: 9/4/15, 11:17 AM