def name_get(self, cr, user, ids, context=None):
if context is None:
context = {}
if not len(ids):
return []
res = []
for r in self.read(cr, user, ids, ['reference_name','category']):
if context.get('category_display', 'type')=='reference' and r['reference_id']:
res.append((r['id'], r['reference_id'][1]))
else:
# make a comma-separated list with the following non-empty elements
elems = [r['reference_name'], r['category']]
categ = ', '.join(filter(bool, elems))
if (context.get('category_display', 'type')=='category') and r['reference_id']:
res.append((r['id'], "%s: %s" % (r['reference_id']categ or '/')))
else:
res.append((r['id'], categ or '/'))
return res
This is my small function the values are coming in reference_id as csv format but i want to use them separately. Kindly help.