From dc05c4b56d88a5688fc2c221372caef6ec862106 Mon Sep 17 00:00:00 2001 From: Olivier Dony Date: Mon, 20 Sep 2010 11:00:56 +0200 Subject: [PATCH 1/2] [IMP] orm.read_group: better readability and efficiency in group sorting bzr revid: odo@openerp.com-20100920090056-xczdsu1o8o8j6015 --- bin/osv/orm.py | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/bin/osv/orm.py b/bin/osv/orm.py index cc2f554da60..67360050212 100644 --- a/bin/osv/orm.py +++ b/bin/osv/orm.py @@ -2268,12 +2268,9 @@ class orm(orm_template): if groupby and fget[groupby]['type'] == 'many2one': data_ids = self.search(cr, uid, [('id', 'in', alldata.keys())], order=groupby, context=context) data_read = self.read(cr, uid, data_ids, groupby and [groupby] or ['id'], context=context) - # restore order of the search as read() uses the default _order: - data = [] - for id in data_ids: - for rec in data_read: - if rec['id'] == id: - data.append(rec) + # restore order of the search as read() uses the default _order (this is only for groups, so the size of data_read shoud be small): + data_read.sort(lambda x,y: cmp(data_ids.index(x['id']), data_ids.index(y['id']))) + data = data_read else: data = self.read(cr, uid, alldata.keys(), groupby and [groupby] or ['id'], context=context) if groupby: From 1b46d73009e8ea255f1db0440f05538f40f977d1 Mon Sep 17 00:00:00 2001 From: "Anup (OpenERP)" Date: Mon, 20 Sep 2010 15:21:34 +0530 Subject: [PATCH 2/2] [FIX] base : INR code and name corrected bzr revid: ach@tinyerp.com-20100920095134-4wezvp033shada97 --- bin/addons/base/base_data.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bin/addons/base/base_data.xml b/bin/addons/base/base_data.xml index 2866c1ea31b..5082adfbfe0 100644 --- a/bin/addons/base/base_data.xml +++ b/bin/addons/base/base_data.xml @@ -1335,8 +1335,8 @@ - INR - Rs + Rs + INR Rs 0.01 4