From 7a4db8a51ead41bfe7cf0f5a2625b8e78341a4cc Mon Sep 17 00:00:00 2001 From: Mahamadasif Ansari Date: Fri, 26 May 2023 04:52:51 +0000 Subject: [PATCH] [FIX] account: change logger type to 'warning' when upload corrupt pdf 'PdfReadError Could not read malformed PDF file' log error is generated when user upload a corrupted PDF file in an invoice. This commit changes the logger exception to a warning to avoid an unnecessary error in the log. sentry-4188965420 closes odoo/odoo#124290 X-original-commit: 834065aab5d62cacbbecb815428a25a37cae2291 Signed-off-by: Quentin De Paoli Signed-off-by: ANSARI MAHAMADASIF (maan) --- addons/account/models/ir_attachment.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/account/models/ir_attachment.py b/addons/account/models/ir_attachment.py index 9bb3befbcc7..1b428b2d262 100644 --- a/addons/account/models/ir_attachment.py +++ b/addons/account/models/ir_attachment.py @@ -49,7 +49,7 @@ class IrAttachment(models.Model): pdf_reader = OdooPdfFileReader(buffer, strict=False) except Exception as e: # Malformed pdf - _logger.exception("Error when reading the pdf: %s", e) + _logger.warning("Error when reading the pdf: %s", e, exc_info=True) return [] # Process embedded files.