[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:
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user