From 2fce001bcda3e2054b7d0c713b973cdde2e28070 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adri=C3=A0=20Tarroja=20Caubet?= Date: Wed, 21 Aug 2024 09:05:33 +0200 Subject: [PATCH] Fallback to 0 when time series value is None Closes #13373 --- modules/sale_opportunity/opportunity_reporting.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/sale_opportunity/opportunity_reporting.py b/modules/sale_opportunity/opportunity_reporting.py index d30d697a2b..fd3903c985 100644 --- a/modules/sale_opportunity/opportunity_reporting.py +++ b/modules/sale_opportunity/opportunity_reporting.py @@ -215,7 +215,7 @@ class Abstract(ModelSQL): name = self._field_name_strip(name, '_trend') if pygal: chart = pygal.Line() - chart.add('', [getattr(ts, name) if ts else 0 + chart.add('', [getattr(ts, name) or 0 if ts else 0 for ts in self.time_series_all]) return chart.render_sparktext()