summaryrefslogtreecommitdiff
path: root/openerp/sql_db.py
diff options
context:
space:
mode:
authordhr-odoo <dhr@openerp.com>2014-10-31 14:18:35 +0530
committerMartin Trigaux <mat@odoo.com>2015-04-22 12:14:33 +0200
commitcb5f00f58016d087cf5387c3eadf9144f45a0397 (patch)
tree528c3a6d7930a1cf89fa6f5598c01dc50659347e /openerp/sql_db.py
parentecdaf89469654214ae07aa447fde14a591f5d9a6 (diff)
[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
Diffstat (limited to 'openerp/sql_db.py')
-rw-r--r--openerp/sql_db.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/openerp/sql_db.py b/openerp/sql_db.py
index 39c87049fb0..8571b3ba08f 100644
--- a/openerp/sql_db.py
+++ b/openerp/sql_db.py
@@ -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