From e49aac8a36a8c1383469a2824983f0bbe0760728 Mon Sep 17 00:00:00 2001 From: Carlos Roca Date: Mon, 15 Apr 2024 13:18:50 +0200 Subject: [PATCH] [FIX] web_pivot_computed_measure: Avoid Infinity errors by comparisons As with the values that computed measurements can take, comparisons can also take these values which are formatted by the function getFormattedVariation. So we extend this method to take infinite values into account. --- .../static/src/pivot/pivot_renderer.esm.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/web_pivot_computed_measure/static/src/pivot/pivot_renderer.esm.js b/web_pivot_computed_measure/static/src/pivot/pivot_renderer.esm.js index ab5f9b0f0..ab1fa8013 100644 --- a/web_pivot_computed_measure/static/src/pivot/pivot_renderer.esm.js +++ b/web_pivot_computed_measure/static/src/pivot/pivot_renderer.esm.js @@ -12,4 +12,10 @@ patch(PivotRenderer.prototype, "web_pivot_computed_measure.PivotRenderer", { } return this._super(...arguments); }, + getFormattedVariation(cell) { + if (Math.abs(cell.value) === Infinity) { + return "-"; + } + return this._super(...arguments); + }, });