From e0b6eb3e6289de4f69b48b7bfe1f36c955f7dfd6 Mon Sep 17 00:00:00 2001 From: Adrian Torres Date: Mon, 9 Oct 2017 09:35:59 +0200 Subject: [PATCH] [FIX] loading: Don't add None to installed apps (#19850) Previous to this rev., sometimes None could be added to the list of _init_modules in the registry, this would then be problematic in ir_http since a sorted would be performed on this list, which works in py2 but in py3 None and string can't be compared implicitly. --- odoo/modules/loading.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/odoo/modules/loading.py b/odoo/modules/loading.py index b56377bcf3e..d8ee12c1690 100644 --- a/odoo/modules/loading.py +++ b/odoo/modules/loading.py @@ -166,7 +166,8 @@ def load_module_graph(cr, graph, status=None, perform_checks=True, skip_modules= overwrite = odoo.tools.config["overwrite_existing_translations"] module.with_context(overwrite=overwrite)._update_translations() - registry._init_modules.add(package.name) + if package.name is not None: + registry._init_modules.add(package.name) if new_install: post_init = package.info.get('post_init_hook') @@ -201,7 +202,8 @@ def load_module_graph(cr, graph, status=None, perform_checks=True, skip_modules= if hasattr(package, kind): delattr(package, kind) - registry._init_modules.add(package.name) + if package.name is not None: + registry._init_modules.add(package.name) cr.commit() _logger.log(25, "%s modules loaded in %.2fs, %s queries", len(graph), time.time() - t0, odoo.sql_db.sql_counter - t0_sql)