From 115c4aa60b1859f78b37cb481784e32cc8a8ab86 Mon Sep 17 00:00:00 2001 From: "Benjamin Frantzen (bfr)" Date: Mon, 12 Oct 2020 08:08:30 +0000 Subject: [FIX]account_edi: set PdfFileReader to strict=False Determines whether user should be warned of all problems and also causes some correctable problems to be fatal. Since we just want the widest compatibility when reading PDF, strict=False seems acceptable. TASK ID: 2358822 closes odoo/odoo#59731 X-original-commit: 9fb637577e0c13778e253b4f1329f59459ab0824 Signed-off-by: Laurent Smet Signed-off-by: bfr-o --- addons/account_edi/models/account_edi_format.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/addons/account_edi/models/account_edi_format.py b/addons/account_edi/models/account_edi_format.py index d22519e4bf2..f9f4d07c322 100644 --- a/addons/account_edi/models/account_edi_format.py +++ b/addons/account_edi/models/account_edi_format.py @@ -231,7 +231,7 @@ class AccountEdiFormat(models.Model): if attachments: # Add the attachments to the pdf file reader_buffer = io.BytesIO(pdf_content) - reader = OdooPdfFileReader(reader_buffer) + reader = OdooPdfFileReader(reader_buffer, strict=False) writer = OdooPdfFileWriter() writer.cloneReaderDocumentRoot(reader) for vals in attachments: @@ -289,7 +289,7 @@ class AccountEdiFormat(models.Model): to_process = [] try: buffer = io.BytesIO(content) - pdf_reader = OdooPdfFileReader(buffer) + pdf_reader = OdooPdfFileReader(buffer, strict=False) except Exception as e: # Malformed pdf _logger.exception("Error when reading the pdf: %s" % e) -- cgit v1.2.3