3
0
Fork 0

[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

Co-authored-by: Alexandre Díaz <alexandre.diaz@tecnativa.com>
12.0
Sylvain LE GAL 2020-10-09 11:37:40 +02:00
parent 27aa521220
commit 857bd84424
1 changed files with 5 additions and 1 deletions

View File

@ -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);
}
}
});
},