From bbcf0c0d492c1c319e9f5d76e5c877f80c61a0c4 Mon Sep 17 00:00:00 2001 From: Holger Brunn Date: Wed, 10 Sep 2014 12:21:40 +0200 Subject: [PATCH] [FIX] cope with empty ids --- attachment_preview/model/ir_attachment.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/attachment_preview/model/ir_attachment.py b/attachment_preview/model/ir_attachment.py index 773367b3..90759649 100644 --- a/attachment_preview/model/ir_attachment.py +++ b/attachment_preview/model/ir_attachment.py @@ -34,6 +34,9 @@ class IrAttachment(Model): cr, uid, ids if isinstance(ids, collections.Iterable) else [ids], context=context): + if not this.id: + result[this.id] = False + continue extension = '' if this.datas_fname: filename, extension = os.path.splitext(this.datas_fname)