From e8e6b346881f1915ae75048698041c78122f1ebc Mon Sep 17 00:00:00 2001 From: Andrea Date: Mon, 17 Dec 2018 15:22:27 +0100 Subject: [PATCH] [FIX] Robustness when attachment not present --- attachment_preview/models/ir_attachment.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/attachment_preview/models/ir_attachment.py b/attachment_preview/models/ir_attachment.py index e1beaf55..0b88b0e7 100644 --- a/attachment_preview/models/ir_attachment.py +++ b/attachment_preview/models/ir_attachment.py @@ -41,7 +41,7 @@ class IrAttachment(models.Model): ids_to_browse = [_id for _id in ids_to_browse if _id not in result] for this in self.env[model].with_context( bin_size=True).browse(ids_to_browse): - if this[binary_field] is None: + if not this[binary_field]: result[this.id] = False continue try: