[FIX] ir_attachement: search, if the model of the ir_attachement has been removed, the search ignore the attachement.

bzr revid: dle@openerp.com-20131206162314-vjpgtag8qhkl1jhk
This commit is contained in:
Denis Ledoux 2013-12-06 17:23:14 +01:00
parent f177669af9
commit 4669f05406
1 changed files with 2 additions and 0 deletions

View File

@ -242,6 +242,8 @@ class ir_attachment(osv.osv):
# performed in batch as much as possible.
ima = self.pool.get('ir.model.access')
for model, targets in model_attachments.iteritems():
if model not in self.pool:
continue
if not ima.check(cr, uid, model, 'read', False):
# remove all corresponding attachment ids
for attach_id in itertools.chain(*targets.values()):