From 5a918cf01de012e45ac580b3fb55d010001129b7 Mon Sep 17 00:00:00 2001 From: Christophe Simonis Date: Wed, 18 Jul 2012 15:10:04 +0200 Subject: [IMP] session_bind is done by openerp.init(). As result, Clients can have template like any other widget as qweb template are loaded. This make the code cleaner as show_common() does not return a deferred anymore. bzr revid: chs@openerp.com-20120718131004-gvn63r3ihzxyzvy3 --- addons/web/static/src/js/boot.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'addons/web/static/src/js/boot.js') diff --git a/addons/web/static/src/js/boot.js b/addons/web/static/src/js/boot.js index 86f8077b151..9f426ee787c 100644 --- a/addons/web/static/src/js/boot.js +++ b/addons/web/static/src/js/boot.js @@ -21,10 +21,10 @@ * * @param {Array} modules list of modules to initialize */ - init: function(modules) { + init: function(modules, origin) { // By default only web will be loaded, the rest will be by loaded // by openerp.web.Session on the first session_authenticate - modules = modules || ["web"]; + modules = _.union(['web'], modules || []); var new_instance = { // links to the global openerp _openerp: openerp, @@ -39,6 +39,9 @@ for(var i=0; i < modules.length; i++) { openerp[modules[i]](new_instance,new_instance[modules[i]]); } + new_instance.connection.synchronized_mode(function() { + new_instance.connection.session_bind(origin); + }); return new_instance; } }; -- cgit v1.2.3 From dccbf4fa818d0c3a61d4e838bf12c396a22848cd Mon Sep 17 00:00:00 2001 From: Christophe Simonis Date: Thu, 19 Jul 2012 13:14:14 +0200 Subject: [FIX] Client must do the session_bind bzr revid: chs@openerp.com-20120719111414-ivf6lq2iymws0ytm --- addons/web/static/src/js/boot.js | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'addons/web/static/src/js/boot.js') diff --git a/addons/web/static/src/js/boot.js b/addons/web/static/src/js/boot.js index 9f426ee787c..c1b1b984abe 100644 --- a/addons/web/static/src/js/boot.js +++ b/addons/web/static/src/js/boot.js @@ -21,7 +21,7 @@ * * @param {Array} modules list of modules to initialize */ - init: function(modules, origin) { + init: function(modules) { // By default only web will be loaded, the rest will be by loaded // by openerp.web.Session on the first session_authenticate modules = _.union(['web'], modules || []); @@ -39,9 +39,6 @@ for(var i=0; i < modules.length; i++) { openerp[modules[i]](new_instance,new_instance[modules[i]]); } - new_instance.connection.synchronized_mode(function() { - new_instance.connection.session_bind(origin); - }); return new_instance; } }; -- cgit v1.2.3