[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 <qdp@odoo.com>
Signed-off-by: ANSARI MAHAMADASIF (maan) <maan@odoo.com>
This commit is contained in:
Mahamadasif Ansari
2023-06-08 17:40:32 +02:00
parent 323bce4f89
commit 7a4db8a51e
+1 -1
View File
@@ -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.