From 6ae04529c203d41659cb8228ddfe9f5f99bd380f 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/__manifest__.py | 2 +- attachment_preview/models/ir_attachment.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/attachment_preview/__manifest__.py b/attachment_preview/__manifest__.py index 7020cd32..ee02c750 100644 --- a/attachment_preview/__manifest__.py +++ b/attachment_preview/__manifest__.py @@ -3,7 +3,7 @@ { "name": "Preview attachments", - "version": "11.0.1.2.0", + "version": "11.0.1.2.1", "author": "Therp BV," "Onestein," "Odoo Community Association (OCA)", 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: