From 5ad882f880da21726e23a0f5296d388290a98bd7 Mon Sep 17 00:00:00 2001 From: Xavier Morel Date: Fri, 30 Sep 2011 17:31:10 +0200 Subject: [PATCH 1/8] [FIX] standalone client default threading bzr revid: xmo@openerp.com-20110930153110-k0pps1wl9d2o12c1 --- openerp-web.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openerp-web.py b/openerp-web.py index 1a349fa601c..c4e6012fb1f 100755 --- a/openerp-web.py +++ b/openerp-web.py @@ -40,7 +40,7 @@ server_options.add_option('--no-serve-static', dest='serve_static', default=True, action='store_false', help="Do not serve static files via this server") server_options.add_option('--multi-threaded', dest='threaded', - default=True, action='store_true', + default=False, action='store_true', help="Spawn one thread per HTTP request") server_options.add_option('--proxy-mode', dest='proxy_mode', default=False, action='store_true', From de41cf72348123feb8e93c481e52d505bfbf8660 Mon Sep 17 00:00:00 2001 From: kbh Date: Mon, 3 Oct 2011 11:32:39 +0530 Subject: [PATCH 2/8] [FIX] change in listview for sidebar. bzr revid: kbh@bde-desktop-20111003060239-v92vo8vc0iiq649k --- addons/web/static/src/js/view_list.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/addons/web/static/src/js/view_list.js b/addons/web/static/src/js/view_list.js index 8a9deaab228..2a3170953c3 100644 --- a/addons/web/static/src/js/view_list.js +++ b/addons/web/static/src/js/view_list.js @@ -505,7 +505,11 @@ openerp.web.ListView = openerp.web.View.extend( /** @lends openerp.web.ListView# do_select: function (ids, records) { this.$element.find('.oe-list-delete') .attr('disabled', !ids.length); - + if(ids.length > 0) { + this.sidebar.do_unfold(); + } else { + this.sidebar.do_fold(); + } if (!records.length) { this.compute_aggregates(); return; From e2acbb9db76b3a51926a743a120cbbf8727d1fb9 Mon Sep 17 00:00:00 2001 From: kbh Date: Mon, 3 Oct 2011 12:48:07 +0530 Subject: [PATCH 3/8] [FIX] Minor change in issue of open sidebar on checked list record. bzr revid: kbh@bde-desktop-20111003071807-9rmozt1m9h9tqxci --- addons/web/static/src/js/view_list.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/web/static/src/js/view_list.js b/addons/web/static/src/js/view_list.js index 2a3170953c3..c8d9bbe270e 100644 --- a/addons/web/static/src/js/view_list.js +++ b/addons/web/static/src/js/view_list.js @@ -505,7 +505,7 @@ openerp.web.ListView = openerp.web.View.extend( /** @lends openerp.web.ListView# do_select: function (ids, records) { this.$element.find('.oe-list-delete') .attr('disabled', !ids.length); - if(ids.length > 0) { + if(ids.length) { this.sidebar.do_unfold(); } else { this.sidebar.do_fold(); From bb596c1bfcd4bb386575f4a36bea264f00597861 Mon Sep 17 00:00:00 2001 From: Xavier Morel Date: Mon, 3 Oct 2011 10:41:50 +0200 Subject: [PATCH 4/8] [FIX] al hacks bzr revid: xmo@openerp.com-20111003084150-6ti0fa221h14wiik --- addons/web/common/dispatch.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/addons/web/common/dispatch.py b/addons/web/common/dispatch.py index 245624f2299..cb998caf891 100644 --- a/addons/web/common/dispatch.py +++ b/addons/web/common/dispatch.py @@ -3,6 +3,7 @@ from __future__ import with_statement import functools import logging +import urllib import os import pprint import sys @@ -309,7 +310,7 @@ class Root(object): by the server, will be filtered by this pattern """ def __init__(self, options): - self.root = '/web/webclient/home?debug=1' + self.root = '/web/webclient/home' self.config = options if self.config.backend == 'local': @@ -348,7 +349,9 @@ class Root(object): request.parameter_storage_class = werkzeug.datastructures.ImmutableDict if request.path == '/': - return werkzeug.utils.redirect(self.root, 301)(environ, start_response) + params = urllib.urlencode(dict(request.args, debug='')) + return werkzeug.utils.redirect(self.root + '?' + params, 301)( + environ, start_response) elif request.path == '/mobile': return werkzeug.utils.redirect( '/web_mobile/static/src/web_mobile.html', 301)(environ, start_response) From a9da2abd9f2ebcf1ecb548c683c8aeeaa7ffb72e Mon Sep 17 00:00:00 2001 From: Xavier Morel Date: Mon, 3 Oct 2011 11:07:09 +0200 Subject: [PATCH 5/8] [FIX] double-load on successful login Session#session_restore is automatically called when the client session is started, and it performs an RPC call. This RPC call is checked and leads to the opening of the login form iif the user is not currently logged in (does not have a valid session). Due to the behavior of Session#rpc_ajax, this failure on grounds of invalid session leads to the restore continuation being stored for deferred execution once the user logs in. Issue is that both Session#session_login and Session#session_restore call Session#on_session_valid which tries to load all modules. As a result and because the '_modules_loaded' flag is only set five billion years after 'load_modules' is called both calls will try to load all modules in parallel, leading to double downloading and execution of all JS and CSS files coming from module data (including translation files). bzr revid: xmo@openerp.com-20111003090709-ree0luomezw1wzup --- addons/web/static/src/js/core.js | 2 -- 1 file changed, 2 deletions(-) diff --git a/addons/web/static/src/js/core.js b/addons/web/static/src/js/core.js index 2e9294ded12..5bc6bc92b68 100644 --- a/addons/web/static/src/js/core.js +++ b/addons/web/static/src/js/core.js @@ -486,8 +486,6 @@ openerp.web.Session = openerp.web.CallbackEnabled.extend( /** @lends openerp.web self.user_context = result.context; self.db = result.db; self.session_save(); - if (self.uid) - self.on_session_valid(); return true; }).then(success_callback); }, From d9f58e3aac57ca15c6c2f1818cb5063a8af8cbb4 Mon Sep 17 00:00:00 2001 From: Xavier Morel Date: Mon, 3 Oct 2011 12:27:21 +0200 Subject: [PATCH 6/8] [FIX] installing a module should trigger the launch of any pending configuration wizard bzr revid: xmo@openerp.com-20111003102721-ivoioohg83r8tdx3 --- addons/web_default_home/static/src/js/home.js | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/addons/web_default_home/static/src/js/home.js b/addons/web_default_home/static/src/js/home.js index ed8561bc44d..67964351873 100644 --- a/addons/web_default_home/static/src/js/home.js +++ b/addons/web_default_home/static/src/js/home.js @@ -94,8 +94,10 @@ openerp.web_default_home = function (openerp) { }) }, install_module: function (module_name) { + var self = this; var Modules = new openerp.web.DataSetSearch( - this, 'ir.module.module', null, [['name', '=', module_name], ['state', '=', 'uninstalled']]); + this, 'ir.module.module', null, + [['name', '=', module_name], ['state', '=', 'uninstalled']]); var Upgrade = new openerp.web.DataSet(this, 'base.module.upgrade'); $.blockUI({message:''}); @@ -105,13 +107,21 @@ openerp.web_default_home = function (openerp) { [_.pluck(records, 'id'), 'to install', ['uninstalled']], function () { Upgrade.call('upgrade_module', [[]], function () { - $.unblockUI(); - // TODO: less brutal reloading - window.location.reload(true); + self.run_configuration_wizards(); }); } ) }); + }, + run_configuration_wizards: function () { + var self = this; + new openerp.web.DataSet(this, 'res.config').call('start', [[]], function (action) { + $.unblockUI(); + self.do_action(action, function () { + // TODO: less brutal reloading + window.location.reload(true); + }); + }); } }); }; From e5e4ab5739de9543c3c0fcc235d7aef506ec8640 Mon Sep 17 00:00:00 2001 From: Fabien Meghazi Date: Mon, 3 Oct 2011 17:00:49 +0200 Subject: [PATCH 7/8] [FIX] Fixed error for sidebar-less embedded list views bzr revid: fme@openerp.com-20111003150049-n5xtpo0wjibsrhjx --- addons/web/static/src/js/view_list.js | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/addons/web/static/src/js/view_list.js b/addons/web/static/src/js/view_list.js index c8d9bbe270e..c78adf769bd 100644 --- a/addons/web/static/src/js/view_list.js +++ b/addons/web/static/src/js/view_list.js @@ -505,10 +505,12 @@ openerp.web.ListView = openerp.web.View.extend( /** @lends openerp.web.ListView# do_select: function (ids, records) { this.$element.find('.oe-list-delete') .attr('disabled', !ids.length); - if(ids.length) { - this.sidebar.do_unfold(); - } else { - this.sidebar.do_fold(); + if (this.sidebar) { + if (ids.length) { + this.sidebar.do_unfold(); + } else { + this.sidebar.do_fold(); + } } if (!records.length) { this.compute_aggregates(); From 2bb8cadb4dcf7311df7f056bda77332fe9d7955b Mon Sep 17 00:00:00 2001 From: Valentin Lab Date: Tue, 4 Oct 2011 09:43:21 +0200 Subject: [PATCH 8/8] [imp] notebookpage is now in registry also. bzr revid: valentin.lab@kalysto.org-20111004074321-b2z121y64yynt948 --- addons/web/static/src/js/view_form.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/addons/web/static/src/js/view_form.js b/addons/web/static/src/js/view_form.js index 11ebad8d093..19d9a5ee839 100644 --- a/addons/web/static/src/js/view_form.js +++ b/addons/web/static/src/js/view_form.js @@ -792,8 +792,7 @@ openerp.web.form.WidgetNotebook = openerp.web.form.Widget.extend({ for (var i = 0; i < node.children.length; i++) { var n = node.children[i]; if (n.tag == "page") { - var page = new openerp.web.form.WidgetNotebookPage( - this.view, n, this, this.pages.length); + var page = new (this.view.registry.get_object('notebookpage'))(this.view, n, this, this.pages.length); this.pages.push(page); } } @@ -2781,6 +2780,7 @@ openerp.web.form.widgets = new openerp.web.Registry({ 'frame' : 'openerp.web.form.WidgetFrame', 'group' : 'openerp.web.form.WidgetFrame', 'notebook' : 'openerp.web.form.WidgetNotebook', + 'notebookpage' : 'openerp.web.form.WidgetNotebookPage', 'separator' : 'openerp.web.form.WidgetSeparator', 'label' : 'openerp.web.form.WidgetLabel', 'button' : 'openerp.web.form.WidgetButton',