Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/util/const.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
"__modules_auto_discovery_force_upgrades": {},
"__fix_fk_allowed_cascade": [],
"__no_model_data_delete": {},
"__force_installed_modules": set(),
}

NEARLYWARN = 25 # between info and warning; appear on runbot build page
Expand Down
12 changes: 12 additions & 0 deletions src/util/modules.py
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,16 @@ def module_installed(cr, module):
return modules_installed(cr, module)


def module_force_installed(module):
"""
Return whether a module is force installed during the upgrade.

:param str module: name of the module to check
:rtype: bool
"""
return module in ENVIRON["__force_installed_modules"]


@_warn_usage_outside_base
def uninstall_module(cr, module):
"""
Expand Down Expand Up @@ -655,6 +665,8 @@ def _force_install_module(cr, module, if_installed=None, reason="it has been exp
states = dict(cr.fetchall())
toinstall = [m for m in states if states[m] == "to install"]

ENVIRON["__force_installed_modules"].update(toinstall)

if module in toinstall:
_logger.info(
"force install of module %r (and its dependencies) because %s%s",
Expand Down