Odoo Help


how to remove join and use csv as separate values?

on 5/21/13, 4:02 AM 1,082 views
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]))
                # 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 '/')))
                    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.

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: 5/21/13, 4:02 AM
Seen: 1082 times
Last updated: 3/16/15, 8:10 AM