Skip to content

Commit 6fbf957

Browse files
committed
[FIX] modules: consider unknown modules uninstalled
The function force_install_module could be called before the discovery of new modules. The validation for the module itself is deferred so we could also be lenient with the dependency module validation. closes #356 Signed-off-by: Christophe Simonis (chs) <[email protected]>
1 parent 09d18f5 commit 6fbf957

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/util/modules.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -583,7 +583,10 @@ def force_install_module(cr, module, if_installed=None, reason="it has been expl
583583
"""
584584
if version_gte("saas~14.5"):
585585
if if_installed:
586-
_assert_modules_exists(cr, *if_installed)
586+
try:
587+
_assert_modules_exists(cr, *if_installed)
588+
except UnknownModuleError as e:
589+
_logger.warning("Unknown 'if_installed' modules: %s; consider them as uninstalled.", ", ".join(e.args))
587590
if not if_installed or modules_installed(cr, *if_installed):
588591
cr.execute("SELECT 1 FROM ir_module_module WHERE name = 'base' AND state != 'to upgrade'")
589592
if cr.rowcount:

0 commit comments

Comments
 (0)