Skip to Content
Menu
This question has been flagged
1 Reply
1833 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
Related Posts Replies Views Activity
1
Aug 23
12549
1
Aug 23
11058
1
Jul 23
7228
4
Apr 23
8677
2
Feb 23
17601