From 857bd84424b29d06ae9c2803615659b44a7676b0 Mon Sep 17 00:00:00 2001 From: Sylvain LE GAL Date: Fri, 9 Oct 2020 11:37:40 +0200 Subject: [PATCH] [FIX] web_pivot_computed_measure : do not raise Javascript error in case of no data Update web_pivot_computed_measure/static/src/js/pivot_model.js MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Alexandre Díaz --- web_pivot_computed_measure/static/src/js/pivot_model.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/web_pivot_computed_measure/static/src/js/pivot_model.js b/web_pivot_computed_measure/static/src/js/pivot_model.js index d05ca6016..9e0ce9f1a 100644 --- a/web_pivot_computed_measure/static/src/js/pivot_model.js +++ b/web_pivot_computed_measure/static/src/js/pivot_model.js @@ -127,7 +127,11 @@ odoo.define('web_pivot_computed_measure.PivotModel', function (require) { resData, resComparison), }; } else { - dataPoint[cm.id] = py.eval(cm.operation, dataPoint); + if (dataPoint.__count === 0) { + dataPoint[cm.id] = false; + } else { + dataPoint[cm.id] = py.eval(cm.operation, dataPoint); + } } }); },