summaryrefslogtreecommitdiff
path: root/odoo
diff options
context:
space:
mode:
authorAdrian Torres <adt@odoo.com>2020-03-12 09:40:41 +0000
committerAdrian Torres <adt@odoo.com>2020-03-12 12:26:58 +0000
commit9493f23977269ea4276f086e4b837e99d7117e7e (patch)
tree6e14b15b35cba9a1dcc6c5c03a0923996503b124 /odoo
parentab6acae6a0f8bd819a113978197b336529076d59 (diff)
[FIX] core: do not nag about dependencies for modules to remove
Before this commit: - Install a module - Uninstall the previously installed module - The registry will complain that some dependencies may be missing for the module being uninstalled This happens because we check after the installation / upgrade of modules that none have been left in a transient state to verify that new dependencies have been properly installed and loaded, this applies to 'to install' and 'to upgrade' states however it's not the same for 'to remove' states, as the process of uninstall happens much later in the code. After this commit, simply uninstalling modules will not trigger this error log. Do note that in case of a problem with an uninstall, the function "reset_module_states" will tackle the case of leftover transient states. closes odoo/odoo#47495 X-original-commit: c095a28314f78d1d9854e5e9bcb26014922a4f12 Signed-off-by: Xavier Dollé (xdo) <xdo@odoo.com>
Diffstat (limited to 'odoo')
-rw-r--r--odoo/modules/loading.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/odoo/modules/loading.py b/odoo/modules/loading.py
index 8b6b5a7ea9c..117bd0a4f90 100644
--- a/odoo/modules/loading.py
+++ b/odoo/modules/loading.py
@@ -422,12 +422,13 @@ 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 modules states
- cr.execute("SELECT name from ir_module_module WHERE state IN ('to install', 'to upgrade', 'to remove')")
+ # 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]
if module_list: