diff options
Diffstat (limited to 'addons/web/static/src/js/views/pivot')
| -rw-r--r-- | addons/web/static/src/js/views/pivot/pivot_model.js | 18 |
1 files changed, 2 insertions, 16 deletions
diff --git a/addons/web/static/src/js/views/pivot/pivot_model.js b/addons/web/static/src/js/views/pivot/pivot_model.js index 88d0aee83b8..5758b906421 100644 --- a/addons/web/static/src/js/views/pivot/pivot_model.js +++ b/addons/web/static/src/js/views/pivot/pivot_model.js @@ -440,12 +440,10 @@ var PivotModel = AbstractModel.extend({ // if we don't have the key 'groupBy' in params. In that case, // we want to have the full open state for the groupbys. self._updateTree(old_row.root, self.data.main_row.root); - self._updateMainGroupBys(old_row, self.data.main_row); } if (!('pivot_column_groupby' in (params.context || {}))) { self._updateTree(old_col.root, self.data.main_col.root); - self._updateMainGroupBys(old_col, self.data.main_col); } }); }, @@ -986,7 +984,8 @@ var PivotModel = AbstractModel.extend({ }); var index = 0; - var rowGroupBys = !_.isEmpty(this.data.groupedBy) ? this.data.groupedBy : this.initialRowGroupBys; + var rowGroupBys = !_.isEmpty(this.data.groupedBy) ? this.data.groupedBy : this.initialRowGroupBys.slice(); + this.data.groupedBy = rowGroupBys; var colGroupBys = this.data.colGroupBys; var dataPoint, row, col, attrs, cell_value; var main_row_header, main_col_header; @@ -1119,19 +1118,6 @@ var PivotModel = AbstractModel.extend({ } }, /** - * Updates the groupBys that the main[row | col] holds - * - * @private - * @param {Object} old: The main abstract header before reload - * @param {Object} main: The main abstract header after reload - * - */ - _updateMainGroupBys: function (old, main) { - var new_groupby_length = this._getHeaderDepth(main.root) - 1; - var new_groupby_list = old.root.groupbys.slice(0, new_groupby_length); - main.root.groupbys = new_groupby_list; - }, - /** * @param {Object} old_tree * @param {Object} new_tree */ |
