[FIX] web_pivot_computed_measure: Error when computed measure takes Infinity value

This commit is contained in:
Carlos Roca
2023-06-07 10:21:05 +02:00
parent 31c4dbd6cc
commit 995b7bbbc6
6 changed files with 74 additions and 47 deletions

View File

@@ -0,0 +1,15 @@
/** @odoo-module **/
/* Copyright 2022 Tecnativa - Carlos Roca
* License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html) */
import {PivotRenderer} from "@web/views/pivot/pivot_renderer";
import {patch} from "web.utils";
patch(PivotRenderer.prototype, "web_pivot_computed_measure.PivotRenderer", {
getFormattedValue(cell) {
if (cell.value === Infinity) {
return "-";
}
return this._super(...arguments);
},
});