diff --git a/addons/account/models/ir_actions_report.py b/addons/account/models/ir_actions_report.py index 8cf5b086615..40b5b45a7e2 100644 --- a/addons/account/models/ir_actions_report.py +++ b/addons/account/models/ir_actions_report.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- from collections import OrderedDict - +from zlib import error as zlib_error try: from PyPDF2.errors import PdfStreamError, PdfReadError except ImportError: @@ -36,7 +36,7 @@ class IrActionsReport(models.Model): record = self.env[attachment.res_model].browse(attachment.res_id) try: stream = pdf.add_banner(stream, record.name, logo=True) - except (ValueError, PdfStreamError, PdfReadError, TypeError): + except (ValueError, PdfStreamError, PdfReadError, TypeError, zlib_error): record._message_log(body=_( "There was an error when trying to add the banner to the original PDF.\n" "Please make sure the source file is valid."