From cf7a21d733dab80556426b34ab8cd7a883a731c7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Bidoul?= Date: Wed, 23 Jun 2021 17:25:03 +0000 Subject: [PATCH] [FIX] core: install new dependencies of module to upgrade When a custom module is in 'to upgrade' state, and the code has a dependency that is not yet installed, Odoo refuses to upgrade it, and says the new dependency is unmet. This commit fixes this by also calling button_upgrade() in this situation, and not only for modules in 'installed' state. This situation arises in a version migration scenario. Custom modules are in 'to upgrade' state after migration. If one of these custom modules has a new dependency after migration, it refuses to upgrade. closes odoo/odoo#72942 X-original-commit: d5ffe0159ada953985a23c29e36763599bd10ed9 Signed-off-by: Adrian Torres (adt) --- odoo/modules/loading.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/odoo/modules/loading.py b/odoo/modules/loading.py index 6a92f735ded..b195af35b34 100644 --- a/odoo/modules/loading.py +++ b/odoo/modules/loading.py @@ -437,7 +437,7 @@ def load_modules(db, force_demo=False, status=None, update_module=False): module_names = [k for k, v in tools.config['update'].items() if v] if module_names: - modules = Module.search([('state', '=', 'installed'), ('name', 'in', module_names)]) + modules = Module.search([('state', 'in', ('installed', 'to upgrade')), ('name', 'in', module_names)]) if modules: modules.button_upgrade()