[FIX] fix attachment right access (full access when not linked to an object)
authorChristophe Simonis <christophe@tinyerp.com>
Mon, 23 Mar 2009 13:50:57 +0000 (14:50 +0100)
committerChristophe Simonis <christophe@tinyerp.com>
Mon, 23 Mar 2009 13:50:57 +0000 (14:50 +0100)
lp bug: https://launchpad.net/bugs/347192 fixed

bzr revid: christophe@tinyerp.com-20090323135057-h4w3k6hnbzq88abz

bin/addons/base/ir/ir_attachment.py

index dd1934d..b1a1eef 100644 (file)
@@ -33,7 +33,8 @@ class ir_attachment(osv.osv):
             ids = [ids]
         cr.execute('select distinct res_model from ir_attachment where id in ('+','.join(map(str, ids))+')')
         for obj in cr.fetchall():
-            ima.check(cr, uid, obj[0], mode)
+            if obj[0]:
+                ima.check(cr, uid, obj[0], mode)
 
     def search(self, cr, uid, args, offset=0, limit=None, order=None,
             context=None, count=False):