Merge lp:~unifield-team/unifield-web/listgrid-unlimited-pager-sort-fix into lp:unifield-web

Proposed by Vincent GREINER on 2016-04-01
Status: Rejected
Rejected by: jftempo on 2018-09-14
Proposed branch: lp:~unifield-team/unifield-web/listgrid-unlimited-pager-sort-fix
Merge into: lp:unifield-web
Diff against target: 16 lines (+5/-1)
1 file modified
addons/openerp/widgets/listgrid.py (+5/-1)
To merge this branch: bzr merge lp:~unifield-team/unifield-web/listgrid-unlimited-pager-sort-fix
Reviewer Review Type Date Requested Status
jftempo 2016-04-01 Pending
Review via email: mp+290723@code.launchpad.net

Description of the change

treeview, unlimited page size, sort was not working
(no order param passed to search orm method)

To post a comment you must log in.

Unmerged revisions

4786. By Vincent GREINER on 2016-04-01

[FIX] order column issue with unlimited paging / listgrid unlimited order: order was not properly injected (and was passed as 0)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'addons/openerp/widgets/listgrid.py'
2--- addons/openerp/widgets/listgrid.py 2016-03-16 15:50:01 +0000
3+++ addons/openerp/widgets/listgrid.py 2016-04-01 12:02:07 +0000
4@@ -184,7 +184,11 @@
5 else:
6 ids = proxy.search(search_param, self.offset, self.limit, False, context)
7 else:
8- ids = proxy.search(search_param, 0, 0, 0, context)
9+ if self.sort_key:
10+ sort = self.sort_key + ' ' + self.sort_order + ',id'
11+ else:
12+ sort = False
13+ ids = proxy.search(search_param, 0, 0, sort, context)
14 if len(ids) < self.limit:
15 if self.offset > 0:
16 self.count = len(ids) + self.offset

Subscribers

People subscribed via source and target branches

to all changes: