This question has been flagged
1 Reply
1718 Views

Good morning;

Please i have this code:

obj4 = self.pool.get('check.project.line')

obj_ids4 = obj4.search(cr, uid, [('partner_id', '=', partner_id), ('check', '=', True)], context=context)

res4 = obj4.read(cr, uid, obj_ids4, ['project'], context)

print ('--------------------------liste-------------------------')

print res4[0]['project']

In res[0]['project']: i have a list of project like this:

project1

project1

project1

project2

How can i modify that code to have no repetition so that: project1 and project2.?

Thanks a lot in advance

Avatar
Discard
Best Answer

use this modified code

obj4 = self.pool.get('check.project.line')

obj_ids4 = obj4.search(cr, uid, [('partner_id', '=', partner_id), ('check', '=', True)], context=context)

res4 = obj4.read(cr, uid, set(obj_ids4), ['project'], context)

print ('--------------------------liste-------------------------')

print res4[0]['project']

Avatar
Discard