diff options
| author | Christophe Simonis <chs@odoo.com> | 2015-07-14 15:57:39 +0200 |
|---|---|---|
| committer | Christophe Simonis <chs@odoo.com> | 2015-07-14 15:57:39 +0200 |
| commit | d215a08db100df10cb4ef2529c5be9c1c990e3e1 (patch) | |
| tree | 2b9a4f67370d21cdb9be2c7c9111c3ed1b3928c6 /addons/document/document.py | |
| parent | 8d7733c057bf530214261716af5762036c54eaf8 (diff) | |
| parent | 86d7f529715f1f68fa44da68369dca8ee4c804b1 (diff) | |
[MERGE] forward port of branch 8.0 up to 86d7f52
Diffstat (limited to 'addons/document/document.py')
| -rw-r--r-- | addons/document/document.py | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/addons/document/document.py b/addons/document/document.py index de9f03c773c..0b371f4e82c 100644 --- a/addons/document/document.py +++ b/addons/document/document.py @@ -83,11 +83,12 @@ class document_file(osv.osv): super(document_file, self).check(cr, uid, ids, mode, context=context, values=values) if ids: - self.pool.get('ir.model.access').check(cr, uid, 'document.directory', mode) - # use SQL to avoid recursive loop on read cr.execute('SELECT DISTINCT parent_id from ir_attachment WHERE id in %s AND parent_id is not NULL', (tuple(ids),)) - self.pool.get('document.directory').check_access_rule(cr, uid, [parent_id for (parent_id,) in cr.fetchall()], mode, context=context) + parent_ids = [parent_id for (parent_id,) in cr.fetchall()] + if parent_ids: + self.pool.get('ir.model.access').check(cr, uid, 'document.directory', mode) + self.pool.get('document.directory').check_access_rule(cr, uid, parent_ids, mode, context=context) def search(self, cr, uid, args, offset=0, limit=None, order=None, context=None, count=False): # Grab ids, bypassing 'count' |
