Skip to content

Commit

Permalink
[FIX] core: remove extra exception log, redundant in P3
Browse files Browse the repository at this point in the history
Reverts 2b1d3ff 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#31699

Signed-off-by: Olivier Dony (odo) <odo@openerp.com>
  • Loading branch information
yajo authored and odony committed Mar 8, 2019
1 parent d2d7f57 commit 8da3750
Showing 1 changed file with 0 additions and 1 deletion.
1 change: 0 additions & 1 deletion odoo/models.py
Expand Up @@ -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
Expand Down

0 comments on commit 8da3750

Please sign in to comment.