[FIX] web: return information on pivot measures and groupbys

This commit fixes a bad behavior of the pivot view. By the
past, if there were no data to present in the pivot view, no
information on the pivot view configuration was returned by
the get function. This does not cause problems to the pivot
renderer (by design) but causes problems elsewhere, for
instance in a dashboard view that contains a pivot view.
Indeed, at each update, the dashboard view reinstantiates its
subviews, so that information can be lost if a subview is of
pivot type.
This commit is contained in:
Mathieu Duckerts-Antoine
2018-09-04 17:37:14 +02:00
parent d4b26c3372
commit 5510d808b8
@@ -313,7 +313,12 @@ var PivotModel = AbstractModel.extend({
get: function (options) {
var isRaw = options && options.raw;
if (!this.data.has_data) {
return {has_data: false};
return {
has_data: false,
colGroupBys: this.data.main_col.groupbys,
rowGroupBys: this.data.main_row.groupbys,
measures: this.data.measures,
};
}
return {
colGroupBys: this.data.main_col.groupbys,