summaryrefslogtreecommitdiff
path: root/addons/web/static/src/js/views/graph/graph_controller.js
diff options
context:
space:
mode:
authorAaron Bohy <aab@odoo.com>2017-08-22 14:33:25 +0200
committerAaron Bohy <aab@odoo.com>2017-08-24 07:20:22 +0200
commit42f22a21614ee7967b900736001b8e68b8ad756e (patch)
tree04cc9ba2c44c5b521f18e1008cb4bd10027c775d /addons/web/static/src/js/views/graph/graph_controller.js
parentacb9d60d944f21606ee4a9decb752a7a24c65d9d (diff)
[FIX] web: read context when reloading Graph or Pivot views
Before this rev., keys like pivot_measures, graph_mode..., were correctly took into account at first load of Pivot or Graph view, but not at reload. Those keys are particularily useful when a user saves a research to its favorites. When such a favorite is selected, the view is reloaded and the interesting information is in the context.
Diffstat (limited to 'addons/web/static/src/js/views/graph/graph_controller.js')
-rw-r--r--addons/web/static/src/js/views/graph/graph_controller.js10
1 files changed, 10 insertions, 0 deletions
diff --git a/addons/web/static/src/js/views/graph/graph_controller.js b/addons/web/static/src/js/views/graph/graph_controller.js
index d68808bac1d..77e3f1e7a40 100644
--- a/addons/web/static/src/js/views/graph/graph_controller.js
+++ b/addons/web/static/src/js/views/graph/graph_controller.js
@@ -102,10 +102,20 @@ var GraphController = AbstractController.extend({
});
},
/**
+ * @private
+ */
+ _update: function () {
+ this._updateButtons();
+ return this._super.apply(this, arguments);
+ },
+ /**
* makes sure that the buttons in the control panel matches the current
* state (so, correct active buttons and stuff like that)
*/
_updateButtons: function () {
+ if (!this.$buttons) {
+ return;
+ }
var state = this.model.get();
this.$buttons.find('.o_graph_button').removeClass('active');
this.$buttons