Add issue3228 - Fix result order of search_read

This commit is contained in:
Raimon Esteve 2018-05-17 15:15:31 +02:00
parent 8ad488bbe6
commit 43e5e0593a
2 changed files with 16 additions and 1 deletions

15
issue3228.diff Normal file
View File

@ -0,0 +1,15 @@
diff -r d26dc1c880e8 trytond/trytond/model/modelstorage.py
--- a/trytond/trytond/model/modelstorage.py Thu May 17 15:09:58 2018 +0200
+++ b/trytond/trytond/model/modelstorage.py Thu May 17 15:11:38 2018 +0200
@@ -369,7 +369,10 @@
fields_names = cls._fields.keys()
if 'id' not in fields_names:
fields_names.append('id')
- return cls.read(map(int, records), fields_names)
+ rows = cls.read(map(int, records), fields_names)
+ index = {r.id: i for i, r in enumerate(records)}
+ rows.sort(key=lambda r: index[r['id']])
+ return rows
@classmethod
def _search_domain_active(cls, domain, active_test=True):

2
series
View File

@ -128,7 +128,7 @@ issue6371.diff # stock Do not set effective date on assignation
025476_5154_5155_5456_optimize_move_write_assign.diff # stock optimize move write assign
filestore.diff
stock_lot_check_moves_without_lot_before_lot_required.diff
issue3228.diff # [trytond] Fix result order of search_read
# electr
# issue6626_improve_performance_of_average_cost_price.diff