Merge lp:~openerp-dev/openobject-addons/trunk-bug-1158856-Pooja into lp:openobject-addons

Proposed by Pooja Zankhariya(OpenERP)
Status: Needs review
Proposed branch: lp:~openerp-dev/openobject-addons/trunk-bug-1158856-Pooja
Merge into: lp:openobject-addons
Diff against target: 20 lines (+3/-0)
1 file modified
document/document.py (+3/-0)
To merge this branch: bzr merge lp:~openerp-dev/openobject-addons/trunk-bug-1158856-Pooja
Reviewer Review Type Date Requested Status
OpenERP Core Team Pending
Review via email: mp+156800@code.launchpad.net

Description of the change

Hello,
      I have fixed sorting by documents in list view.

Thanks,
Pooja.

To post a comment you must log in.

Unmerged revisions

8659. By Pooja Zankhariya(OpenERP)

[FIX] sort in document management.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'document/document.py'
2--- document/document.py 2013-03-27 14:01:49 +0000
3+++ document/document.py 2013-04-03 10:34:27 +0000
4@@ -80,6 +80,7 @@
5 if not ids:
6 return 0 if count else []
7
8+ orig_ids = ids
9 # Filter out documents that are in directories that the user is not allowed to read.
10 # Must use pure SQL to avoid access rules exceptions (we want to remove the records,
11 # not fail), and the records have been filtered in parent's search() anyway.
12@@ -99,6 +100,8 @@
13 for parent_id in visible_parent_ids:
14 ids.extend(parents[parent_id])
15
16+ # sort result according to the original sort ordering
17+ ids.sort(key=(orig_ids+ids).index)
18 return len(ids) if count else ids
19
20 def copy(self, cr, uid, id, default=None, context=None):

Subscribers

People subscribed via source and target branches

to all changes: