[FIX] document: polynomial time reordering of document ids
Triggered every time on list views as the list view uses a search_count (filtered but unlimited) to display pagination. closes #6397
This commit is contained in:
parent
f4e1974d67
commit
3cc3ab6252
|
@ -110,8 +110,11 @@ class document_file(osv.osv):
|
||||||
ids.extend(parents[parent_id])
|
ids.extend(parents[parent_id])
|
||||||
|
|
||||||
# sort result according to the original sort ordering
|
# sort result according to the original sort ordering
|
||||||
ids = [id for id in orig_ids if id in ids]
|
if count:
|
||||||
return len(ids) if count else ids
|
return len(ids)
|
||||||
|
else:
|
||||||
|
set_ids = set(ids)
|
||||||
|
return [id for id in orig_ids if id in set_ids]
|
||||||
|
|
||||||
def copy(self, cr, uid, id, default=None, context=None):
|
def copy(self, cr, uid, id, default=None, context=None):
|
||||||
if not default:
|
if not default:
|
||||||
|
|
Loading…
Reference in New Issue