bugfix_attachments

bzr revid: fp@tinyerp.com-20090315181301-u8540hacsu69dy8j
This commit is contained in:
Fabien Pinckaers
2009-03-15 19:13:01 +01:00
parent 8721c8ba0f
commit 8bfb8acf3b
+6 -5
View File
@@ -48,11 +48,12 @@ class ir_attachment(osv.osv):
cache = {}
ima = self.pool.get('ir.model.access')
for m in models:
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 m['res_model']:
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)