Two snippets to get the same list of ids:
id_list = [];
for obj in self.browse(cr, uid, ids, context=None):
for o2m in obj.o2m_field_ids:
id_list.append(o2m.id);
or:
o2m_obj = self.pool.get('o2m.object');
id_list = o2m_obj.search(cr, uid, [('m2o_field_id','in',ids)]);
Which is faster? 'better'? cleaner? more pythonic? more readable? better style?
EDIT:
An actual example would be to collect all tasks of one or more projects:
I could loop over the projects and collect the tasks (browse the projects), or search for all tasks that belong to the given projects (search in tasks).
I think this can make differences in performance, etc.
Thanks.