[FIX] orm: ordering on >1000 records
When reading over IN_MAX (currently 1000) records, the select is slip into subsets of IN_MAX records. However the list of ids was split using set() method which removes order that may have been pass. The subsets are ordered using _order attribute but the subsets were not ordered between themself. This is an issue in case of browsing a o2m field with more than 1000 lines as it will return sorted blocked but the order of the blocks is the order of the contained ids (e.g. split(2, [5, 4, 3, 2, 1]) -> [[2,1], [4,3], [5]]). Removes the set() to make sure the order of the given ids is preserved. opw 616070, linked to #439
This commit is contained in:
parent
ecdaf89469
commit
cb5f00f580
|
@ -255,7 +255,7 @@ class Cursor(object):
|
|||
def split_for_in_conditions(self, ids):
|
||||
"""Split a list of identifiers into one or more smaller tuples
|
||||
safe for IN conditions, after uniquifying them."""
|
||||
return tools.misc.split_every(self.IN_MAX, set(ids))
|
||||
return tools.misc.split_every(self.IN_MAX, ids)
|
||||
|
||||
def print_log(self):
|
||||
global sql_counter
|
||||
|
|
Loading…
Reference in New Issue