From f53ad8a4fd6f1b98625dd659e429177beae7ae80 Mon Sep 17 00:00:00 2001 From: Xavier Morel Date: Mon, 4 Feb 2019 09:17:41 +0000 Subject: [FIX] search_filters: broke a thing in f1a85ba As part of fixing the JS docs (docstrings & references & ...), the various search filters were de-namespaced (aka ExtendedSearchProposition.Integer = ... -> var Integer = ...). This had the side-effect of making a `new Date` refer to the extended search Date field instead of the global Date object, which went unnoticed because *that* had been wrapped in a moment() call, and moment() apparently doesn't mind being given garbage, but it would also create an "unbound" and thus never destroyed widget. Remove the `new Date`, calling moment directly has pretty much the same effect, moment objects created from date objects just have an extra field (a cache for the date object I guess). closes odoo/odoo#30791 --- addons/web/static/src/js/chrome/search_filters.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'addons/web/static/src') diff --git a/addons/web/static/src/js/chrome/search_filters.js b/addons/web/static/src/js/chrome/search_filters.js index 4628578f9fe..05de554da2f 100644 --- a/addons/web/static/src/js/chrome/search_filters.js +++ b/addons/web/static/src/js/chrome/search_filters.js @@ -238,7 +238,7 @@ var DateTime = Field.extend({ _create_new_widget: function (name) { this[name] = new (this._get_widget_class())(this); return this[name].appendTo(this.$el).then((function () { - this[name].setValue(moment(new Date())); + this[name].setValue(moment()); }).bind(this)); }, _get_widget_class: function () { -- cgit v1.2.3 From de8cefcef4d456398e5028c52e3bd9db807e5f8a Mon Sep 17 00:00:00 2001 From: "Lucas Perais (lpe)" Date: Tue, 19 Feb 2019 13:19:13 +0000 Subject: [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 --- addons/web/static/src/js/views/pivot/pivot_model.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'addons/web/static/src') 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); + } }); }, /** -- cgit v1.2.3