[FIX] ir_http: routing map crashes after having run unittests

If the server was launched with ``--test-enable``, `routing_map` tries to load
the routing map of module `None`, which is the current module being tested...
This commit is contained in:
Raphael Collet
2017-09-20 14:52:43 +02:00
parent 30b1b89496
commit f776f9f3dc
+1 -1
View File
@@ -214,7 +214,7 @@ class IrHttp(models.AbstractModel):
if not hasattr(cls, '_routing_map'):
_logger.info("Generating routing map")
installed = request.registry._init_modules - {'web'}
if tools.config['test_enable']:
if tools.config['test_enable'] and odoo.modules.module.current_test:
installed.add(odoo.modules.module.current_test)
mods = [''] + odoo.conf.server_wide_modules + sorted(installed)
# Note : when routing map is generated, we put it on the class `cls`