bugfix_attachments
bzr revid: fp@tinyerp.com-20090315181301-u8540hacsu69dy8j
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user