From 3332f26cc2244aaeabde71dce2d8a9e96a1d75bb Mon Sep 17 00:00:00 2001 From: Christophe Simonis Date: Fri, 5 Dec 2008 12:54:09 +0100 Subject: [PATCH] [FIX] fix the access rights verification in attachments bzr revid: christophe@tinyerp.com-20081205115409-rlk3mq4fw89f1hue --- bin/addons/base/ir/ir_attachment.py | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/bin/addons/base/ir/ir_attachment.py b/bin/addons/base/ir/ir_attachment.py index e71b227fcff..e1a04a5f85a 100644 --- a/bin/addons/base/ir/ir_attachment.py +++ b/bin/addons/base/ir/ir_attachment.py @@ -52,12 +52,11 @@ class ir_attachment(osv.osv): cache = {} ima = self.pool.get('ir.model.access') for m in models: - if m['res_model'] in cache: - if not cache[m['res_model']]: - ids.remove(m['id']) - continue - cache[m['res_model']] = ima.check(cr, uid, m['res_model'], 'read', - raise_exception=False) + if m['res_model'] not in cache: + cache[m['res_model']] = ima.check(cr, uid, m['res_model'], 'read', + raise_exception=False) + if not cache[m['res_model']]: + ids.remove(m['id']) if count: return len(ids)