diff options
| author | Benjamin Frantzen (bfr) <bfr@odoo.com> | 2020-10-12 08:08:30 +0000 |
|---|---|---|
| committer | Benjamin Frantzen (bfr) <bfr@odoo.com> | 2020-10-12 10:38:59 +0000 |
| commit | 115c4aa60b1859f78b37cb481784e32cc8a8ab86 (patch) | |
| tree | 18dce202de6f0ceb54f9cfcd14336abd95d4e3ed /addons/account_edi | |
| parent | 0218d870d319af4f263d5e9aa324990f7cc90139 (diff) | |
[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 <smetl@users.noreply.github.com>
Signed-off-by: bfr-o <bfr-o@users.noreply.github.com>
Diffstat (limited to 'addons/account_edi')
| -rw-r--r-- | addons/account_edi/models/account_edi_format.py | 4 |
1 files 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) |
