From b8922c964cfcf836be2c1afde3cf0bb4cd817ead Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=A9ry=20Debongnie?= Date: Wed, 1 Feb 2017 11:29:17 +0100 Subject: [PATCH] web: pivot view properly updates measure list Before this commit, when changing measures from the favorites menu (by selecting a filter with some pivot_measures), the measures in the dropdown menus were not correctly updated. This commits make sure that we update the active measures in the menu after each changes coming from a do_search. --- addons/web/static/src/js/views/pivot_view.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/addons/web/static/src/js/views/pivot_view.js b/addons/web/static/src/js/views/pivot_view.js index a3649da9d7f..d275e122285 100644 --- a/addons/web/static/src/js/views/pivot_view.js +++ b/addons/web/static/src/js/views/pivot_view.js @@ -209,6 +209,10 @@ var PivotView = View.extend({ this.do_push_state({}); this.data_loaded.done(function () { self.display_table(); + self.$buttons.find('.o_pivot_measures_list li').removeClass('selected'); + self.active_measures.forEach(function (measure) { + self.$buttons.find('li[data-field="' + measure + '"]').addClass('selected'); + }); }); return this._super(); },