[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.
This commit is contained in:
Olivier Dony
2015-09-11 18:31:49 +02:00
parent 88eaa7dad8
commit 622eecec8f
+5 -1
View File
@@ -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)