From b7988bcc5a5cd8495204fea1b44d8fcb5fc23b49 Mon Sep 17 00:00:00 2001 From: Denis Ledoux Date: Tue, 19 Nov 2013 15:02:46 +0100 Subject: [PATCH] [FIX] ir, ir_attachement: traceback if try to create attachement without res_id, caused by check access rights trying to check if the user had the right to read the object with a res_id 0 bzr revid: dle@openerp.com-20131119140246-r8dd7h0di4aigjss --- openerp/addons/base/ir/ir_attachment.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openerp/addons/base/ir/ir_attachment.py b/openerp/addons/base/ir/ir_attachment.py index 6cfcd7c4d99..8031ea8f75e 100644 --- a/openerp/addons/base/ir/ir_attachment.py +++ b/openerp/addons/base/ir/ir_attachment.py @@ -198,7 +198,7 @@ class ir_attachment(osv.osv): continue res_ids.setdefault(rmod,set()).add(rid) if values: - if values.get('res_model') and 'res_id' in values: + if values.get('res_model') and values.get('res_id'): res_ids.setdefault(values['res_model'],set()).add(values['res_id']) ima = self.pool.get('ir.model.access')