summaryrefslogtreecommitdiff
path: root/addons/web_graph/static/src/js/graph_widget.js
diff options
context:
space:
mode:
Diffstat (limited to 'addons/web_graph/static/src/js/graph_widget.js')
-rw-r--r--addons/web_graph/static/src/js/graph_widget.js18
1 files changed, 9 insertions, 9 deletions
diff --git a/addons/web_graph/static/src/js/graph_widget.js b/addons/web_graph/static/src/js/graph_widget.js
index d6f9b929dea..84ca75ddda2 100644
--- a/addons/web_graph/static/src/js/graph_widget.js
+++ b/addons/web_graph/static/src/js/graph_widget.js
@@ -43,6 +43,13 @@ openerp.web_graph.Graph = openerp.web.Widget.extend({
this.$('.graph_main_content').addClass('graph_pivot_mode');
}
+ // get search view
+ var parent = this.getParent();
+ while (!(parent instanceof openerp.web.ViewManager)) {
+ parent = parent.getParent();
+ }
+ this.search_view = parent.searchview;
+
openerp.session.rpc('/web_graph/check_xlwt').then(function (result) {
self.$('.graph_options_selection label').toggle(result);
});
@@ -76,16 +83,9 @@ openerp.web_graph.Graph = openerp.web.Widget.extend({
// this method gets the fields that appear in the search view, under the
// 'Groupby' heading
get_search_fields: function () {
- var self = this,
- parent = this.getParent();
-
- while (!(parent instanceof openerp.web.ViewManager)) {
- parent = parent.getParent();
- }
-
- var search_view = parent.searchview;
+ var self = this;
- var groupbygroups = _(search_view.inputs).select(function (g) {
+ var groupbygroups = _(this.search_view.inputs).select(function (g) {
return g instanceof openerp.web.search.GroupbyGroup;
});