summaryrefslogtreecommitdiff
path: root/addons/web/static/src/js/views/graph
diff options
context:
space:
mode:
authorAaron Bohy <aab@odoo.com>2017-06-01 09:57:16 +0200
committerAaron Bohy <aab@odoo.com>2017-06-01 12:02:17 +0200
commit033aec082669d6fb8126d6740b8aa7d09a2831d3 (patch)
tree044773d7547cf8614f360e8664b209fcc4f4af85 /addons/web/static/src/js/views/graph
parent2a4a011256f9f0d44546c6082ec1ccf4450bff52 (diff)
[FIX] web: Graph: correctly return graph's context
allowing to properly save the current state (mode, measure, groupbys) of the view in the Favorites or add it to the dashboard.
Diffstat (limited to 'addons/web/static/src/js/views/graph')
-rw-r--r--addons/web/static/src/js/views/graph/graph_controller.js16
1 files changed, 16 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 388d390701c..d68808bac1d 100644
--- a/addons/web/static/src/js/views/graph/graph_controller.js
+++ b/addons/web/static/src/js/views/graph/graph_controller.js
@@ -40,6 +40,22 @@ var GraphController = AbstractController.extend({
//--------------------------------------------------------------------------
/**
+ * Returns the current mode, measure and groupbys, so we can restore the
+ * view when we save the current state in the search view, or when we add it
+ * to the dashboard.
+ *
+ * @override
+ * @returns {Object}
+ */
+ getContext: function () {
+ var state = this.model.get();
+ return {
+ graph_measure: state.measure,
+ graph_mode: state.mode,
+ graph_groupbys: state.groupedBy,
+ };
+ },
+ /**
* Render the buttons according to the GraphView.buttons and
* add listeners on it.
* Set this.$buttons with the produced jQuery element