diff options
| author | Jérome Maes <jem@openerp.com> | 2015-01-07 12:01:54 +0100 |
|---|---|---|
| committer | Martin Trigaux <mat@odoo.com> | 2015-03-26 14:48:18 +0100 |
| commit | f89c4cd78def1ea3f0b3ab4f44dc3308cd30a5a5 (patch) | |
| tree | 875f9067dda30a8348cbbbbd1d88d7909d7bd1b7 | |
| parent | d79a1622bb99338438ab0378643065988b9d6c65 (diff) | |
[FIX] document : keep order during the search of ir.attachment
Backport of 16fa24d52258245af4ee9100666bae6ebe664046
| -rw-r--r-- | addons/document/document.py | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/addons/document/document.py b/addons/document/document.py index 5384ee0fb18..df12431df7a 100644 --- a/addons/document/document.py +++ b/addons/document/document.py @@ -104,10 +104,13 @@ class document_file(osv.osv): visible_parent_ids = self.pool.get('document.directory').search(cr, uid, [('id', 'in', list(parent_ids))]) # null parents means allowed + orig_ids = ids # save the ids, to keep order ids = parents.get(None,[]) for parent_id in visible_parent_ids: ids.extend(parents[parent_id]) + # sort result according to the original sort ordering + ids = [id for id in orig_ids if id in ids] return len(ids) if count else ids def copy(self, cr, uid, id, default=None, context=None): |
