summaryrefslogtreecommitdiff
path: root/addons/web/static/src/js/views/graph/graph_view.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_view.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_view.js')
-rw-r--r--addons/web/static/src/js/views/graph/graph_view.js8
1 files changed, 4 insertions, 4 deletions
diff --git a/addons/web/static/src/js/views/graph/graph_view.js b/addons/web/static/src/js/views/graph/graph_view.js
index 08b5ce1968f..423d52ca64c 100644
--- a/addons/web/static/src/js/views/graph/graph_view.js
+++ b/addons/web/static/src/js/views/graph/graph_view.js
@@ -27,7 +27,7 @@ var GraphView = AbstractView.extend({
/**
* @override
*/
- init: function (viewInfo, params) {
+ init: function (viewInfo) {
this._super.apply(this, arguments);
var measure;
@@ -57,9 +57,9 @@ var GraphView = AbstractView.extend({
this.controllerParams.measures = measures;
this.rendererParams.stacked = viewInfo.arch.attrs.stacked !== "False";
- this.loadParams.mode = params.context.graph_mode || viewInfo.arch.attrs.type || 'bar';
- this.loadParams.measure = params.context.graph_measure || measure || '__count__';
- this.loadParams.groupBys = params.context.graph_groupbys || groupBys || [];
+ this.loadParams.mode = viewInfo.arch.attrs.type || 'bar';
+ this.loadParams.measure = measure || '__count__';
+ this.loadParams.groupBys = groupBys || [];
this.loadParams.fields = viewInfo.fields;
},
});