Skip to Content
Menu
This question has been flagged
2 Replies
5529 Views
Best Answer

try name_get override

Avatar
Discard
Best Answer


_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

Avatar
Discard