From 09985fd42a930cf669ff066aa6ac16a1c9bdb6c4 Mon Sep 17 00:00:00 2001 From: Florent de Labarre Date: Thu, 15 Jul 2021 03:59:04 +0000 Subject: [PATCH] [FIX] stock: Exception are not correctly logged Il during the scheduler an exception append, the error is not correctly logged. This PR allow to catch the error with logger analyser (like sentry). closes odoo/odoo#82648 X-original-commit: c68e1d1c13d116bda6b91fcbbcd61a26739a9894 Signed-off-by: Raphael Collet Co-authored-by: Raphael Collet --- addons/stock/models/stock_rule.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/addons/stock/models/stock_rule.py b/addons/stock/models/stock_rule.py index a58e4b6c9c3..cc198604ac3 100644 --- a/addons/stock/models/stock_rule.py +++ b/addons/stock/models/stock_rule.py @@ -562,6 +562,9 @@ class ProcurementGroup(models.Model): self = self.with_env(self.env(cr=cr)) # TDE FIXME self._run_scheduler_tasks(use_new_cursor=use_new_cursor, company_id=company_id) + except Exception: + _logger.error("Error during stock scheduler", exc_info=True) + raise finally: if use_new_cursor: try: