summaryrefslogtreecommitdiff
path: root/odoo/modules/loading.py
diff options
context:
space:
mode:
authorChristophe Simonis <chs@odoo.com>2021-01-07 10:29:31 +0000
committerChristophe Simonis <chs@odoo.com>2021-01-07 14:30:14 +0000
commitc9ba163e96c61375873f0efcda10be6b48531d63 (patch)
tree136e45dec471db3b80e036917f9003617b645313 /odoo/modules/loading.py
parenta72f7222c9f5987a20461be9c837e3de73801ff7 (diff)
[FIX] core: check module state inconsistencies after `end` upgrade scripts
Some modules may be removed by the upgrade scripts with the help of the ORM and are done in `end` scripts. This is the case for uninstalling the themes which use the `_theme_remove` method [1]. [1] in 12.0: https://github.com/odoo/odoo/blob/e2084a4356f63249920d8c777e92f1710be8b5a6/addons/website_theme_install/models/ir_module_module.py#L337 closes odoo/odoo#64216 X-original-commit: e5ab5410dbc006fc4bcdd21e603026483bf5d360 Signed-off-by: Xavier Dollé (xdo) <xdo@odoo.com> Signed-off-by: Christophe Simonis <chs@odoo.com>
Diffstat (limited to 'odoo/modules/loading.py')
-rw-r--r--odoo/modules/loading.py12
1 files changed, 6 insertions, 6 deletions
diff --git a/odoo/modules/loading.py b/odoo/modules/loading.py
index 50cbffa83ed..56dbb0639a6 100644
--- a/odoo/modules/loading.py
+++ b/odoo/modules/loading.py
@@ -454,12 +454,6 @@ def load_modules(db, force_demo=False, status=None, update_module=False):
['to install'], force, status, report,
loaded_modules, update_module, models_to_check)
- # check that new module dependencies have been properly installed after a migration/upgrade
- cr.execute("SELECT name from ir_module_module WHERE state IN ('to install', 'to upgrade')")
- module_list = [name for (name,) in cr.fetchall()]
- if module_list:
- _logger.error("Some modules have inconsistent states, some dependencies may be missing: %s", sorted(module_list))
-
# check that all installed modules have been loaded by the registry after a migration/upgrade
cr.execute("SELECT name from ir_module_module WHERE state = 'installed' and name != 'studio_customization'")
module_list = [name for (name,) in cr.fetchall() if name not in graph]
@@ -474,6 +468,12 @@ def load_modules(db, force_demo=False, status=None, update_module=False):
for package in graph:
migrations.migrate_module(package, 'end')
+ # check that new module dependencies have been properly installed after a migration/upgrade
+ cr.execute("SELECT name from ir_module_module WHERE state IN ('to install', 'to upgrade')")
+ module_list = [name for (name,) in cr.fetchall()]
+ if module_list:
+ _logger.error("Some modules have inconsistent states, some dependencies may be missing: %s", sorted(module_list))
+
# STEP 3.6: apply remaining constraints in case of an upgrade
registry.finalize_constraints()