diff options
| author | Lucas Perais (lpe) <lpe@odoo.com> | 2019-02-19 13:19:13 +0000 |
|---|---|---|
| committer | Lucas Perais (lpe) <lpe@odoo.com> | 2019-02-19 15:12:28 +0000 |
| commit | de8cefcef4d456398e5028c52e3bd9db807e5f8a (patch) | |
| tree | fa6d4ec2293e19d896c2e13471bb94a0a6558194 /addons/web/static/src/js/views/pivot/pivot_model.js | |
| parent | 66392a9fff6ea110c90a8df7370d766772e6c689 (diff) | |
[FIX] web: pivot unload filter, reset, load another filter
On a pivot view with a default filter which has column and row groupbys
Remove the filter
Collapse all columns and rows
Activate another Filter from favorite which has a column groupby at least
Before this commit, the columns were not displayed in the DOM, though RPC's
and internal data were actually correct
This was because we considered the changes had been done "in place"
taking the old tree to build the new one for the columns
when really, we should have recomputed the column tree
After this commit, the columns display the group we want
OPW 1935155
closes odoo/odoo#31247
Diffstat (limited to 'addons/web/static/src/js/views/pivot/pivot_model.js')
| -rw-r--r-- | addons/web/static/src/js/views/pivot/pivot_model.js | 6 |
1 files changed, 4 insertions, 2 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 95815a03e76..90163c5ec27 100644 --- a/addons/web/static/src/js/views/pivot/pivot_model.js +++ b/addons/web/static/src/js/views/pivot/pivot_model.js @@ -277,8 +277,10 @@ var PivotModel = AbstractModel.extend({ self._updateMainGroupBys(old_row, self.data.main_row); } - self._updateTree(old_col.root, self.data.main_col.root); - self._updateMainGroupBys(old_col, self.data.main_col); + 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); + } }); }, /** |
