From ec186dfb7d394a337744a70aab3b042feeddbbf8 Mon Sep 17 00:00:00 2001 From: Xavier Morel Date: Mon, 20 Jun 2011 16:39:46 +0200 Subject: [FIX] race condition between graph view loading and search request: View.start() should return a promise if it makes an async call, so caller (ViewManager in this case) knows when the graph view is ready for action Also inherit from View bzr revid: xmo@openerp.com-20110620143946-tv0qx84e0y06zxu7 --- addons/base_graph/static/src/js/graph.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'addons/base_graph/static/src/js/graph.js') diff --git a/addons/base_graph/static/src/js/graph.js b/addons/base_graph/static/src/js/graph.js index d5c16f1cb90..4dec023b93f 100644 --- a/addons/base_graph/static/src/js/graph.js +++ b/addons/base_graph/static/src/js/graph.js @@ -14,7 +14,7 @@ var COLOR_PALETTE = [ QWeb.add_template('/base_graph/static/src/xml/base_graph.xml'); openerp.base.views.add('graph', 'openerp.base_graph.GraphView'); -openerp.base_graph.GraphView = openerp.base.Controller.extend({ +openerp.base_graph.GraphView = openerp.base.View.extend({ init: function(view_manager, session, element_id, dataset, view_id) { this._super(session, element_id); @@ -31,7 +31,7 @@ openerp.base_graph.GraphView = openerp.base.Controller.extend({ this.$element.hide(); }, start: function() { - this.rpc("/base_graph/graphview/load", {"model": this.model, "view_id": this.view_id}, this.on_loaded); + return this.rpc("/base_graph/graphview/load", {"model": this.model, "view_id": this.view_id}, this.on_loaded); }, on_loaded: function(data) { this.all_fields = data.all_fields; -- cgit v1.2.3