From 0f6510edfc63ea2e6fa12d555e28ab050654f599 Mon Sep 17 00:00:00 2001 From: Olivier Dony Date: Fri, 9 Sep 2011 17:50:25 +0200 Subject: [PATCH] [FIX] ir.attachment: cleaner check for record existence in access rights bzr revid: odo@openerp.com-20110909155025-cyhnmy89e9a0ijzt --- openerp/addons/base/ir/ir_attachment.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/openerp/addons/base/ir/ir_attachment.py b/openerp/addons/base/ir/ir_attachment.py index 95a4cd8cab0..0612c1861d8 100644 --- a/openerp/addons/base/ir/ir_attachment.py +++ b/openerp/addons/base/ir/ir_attachment.py @@ -50,8 +50,7 @@ class ir_attachment(osv.osv): for model, mids in res_ids.items(): # ignore attachments that are not attached to a resource anymore when checking access rights # (resource was deleted but attachment was not) - cr.execute('select id from '+self.pool.get(model)._table+' where id in %s', (tuple(mids),)) - mids = [x[0] for x in cr.fetchall()] + mids = self.pool.get(model).exists(cr, uid, mids) ima.check(cr, uid, model, mode) self.pool.get(model).check_access_rule(cr, uid, mids, mode, context=context)