From 8da3750cee37532d2060bc0c4271a15bc1511dc2 Mon Sep 17 00:00:00 2001 From: Jairo Llopis Date: Fri, 8 Mar 2019 10:02:30 +0000 Subject: [PATCH] [FIX] core: remove extra exception log, redundant in P3 Reverts 2b1d3ff82dd23fb0372b3b73ecb84841a0d593d3 introduced in 10.0 via It was relatively useful in Odoo 10.0 because in Python 2 the exception was missing a root cause traceback. But Python 3 includes exception chaining by default, so it comes for free. See [PEP3134](https://legacy.python.org/dev/peps/pep-3134/) On top of being redundant in P3, it can also break some testcases by causing an extra ERROR log entry, even when the final exception is expected and caught. So it's simpler to remove it. closes odoo/odoo#31699 Signed-off-by: Olivier Dony (odo) --- odoo/models.py | 1 - 1 file changed, 1 deletion(-) diff --git a/odoo/models.py b/odoo/models.py index f7bcd57b074ac..bedf7fec10e98 100644 --- a/odoo/models.py +++ b/odoo/models.py @@ -1038,7 +1038,6 @@ def _validate_fields(self, field_names): except ValidationError as e: raise except Exception as e: - _logger.exception('Exception while validating constraint') raise ValidationError("%s\n\n%s" % (_("Error while validating constraint"), tools.ustr(e))) @api.model