[FIX] Robustness when attachment not present

This commit is contained in:
Andrea 2018-12-17 15:22:27 +01:00 committed by anusrinps96
parent 77a20f38a9
commit 22c9aa54d0
2 changed files with 2 additions and 2 deletions

View File

@ -3,7 +3,7 @@
{ {
"name": "Preview attachments", "name": "Preview attachments",
"version": "11.0.1.2.0", "version": "11.0.1.2.1",
"author": "Therp BV," "author": "Therp BV,"
"Onestein," "Onestein,"
"Odoo Community Association (OCA)", "Odoo Community Association (OCA)",

View File

@ -41,7 +41,7 @@ class IrAttachment(models.Model):
ids_to_browse = [_id for _id in ids_to_browse if _id not in result] ids_to_browse = [_id for _id in ids_to_browse if _id not in result]
for this in self.env[model].with_context( for this in self.env[model].with_context(
bin_size=True).browse(ids_to_browse): bin_size=True).browse(ids_to_browse):
if this[binary_field] is None: if not this[binary_field]:
result[this.id] = False result[this.id] = False
continue continue
try: try: