From 4669f05406b07074c38b4d19c0c2ddf4e9407918 Mon Sep 17 00:00:00 2001 From: Denis Ledoux Date: Fri, 6 Dec 2013 17:23:14 +0100 Subject: [PATCH] [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 --- openerp/addons/base/ir/ir_attachment.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/openerp/addons/base/ir/ir_attachment.py b/openerp/addons/base/ir/ir_attachment.py index 8031ea8f75e..6bf2266b412 100644 --- a/openerp/addons/base/ir/ir_attachment.py +++ b/openerp/addons/base/ir/ir_attachment.py @@ -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()):