From 622eecec8f33151097a3adda609be3df22971885 Mon Sep 17 00:00:00 2001 From: Olivier Dony Date: Wed, 9 Sep 2015 12:09:39 +0200 Subject: [PATCH] [FIX] http: load routes from all installed modules When a module uninstallation fails, its views and templates are still present in the database, and its routes should still be loaded. Otherwise random inconsistencies and errors may occur when rendering the modules' templates. --- openerp/addons/base/ir/ir_http.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/openerp/addons/base/ir/ir_http.py b/openerp/addons/base/ir/ir_http.py index 48479528bd0..b03f654a03f 100644 --- a/openerp/addons/base/ir/ir_http.py +++ b/openerp/addons/base/ir/ir_http.py @@ -193,7 +193,11 @@ class ir_http(osv.AbstractModel): _logger.info("Generating routing map") cr = request.cr m = request.registry.get('ir.module.module') - ids = m.search(cr, openerp.SUPERUSER_ID, [('state', '=', 'installed'), ('name', '!=', 'web')], context=request.context) + ids = m.search( + cr, openerp.SUPERUSER_ID, + [('state', 'in', ('installed', 'to remove', 'to upgrade')), + ('name', '!=', 'web')], + context=request.context) installed = set(x['name'] for x in m.read(cr, 1, ids, ['name'], context=request.context)) if openerp.tools.config['test_enable']: installed.add(openerp.modules.module.current_test)