Skip to content

[ADD] modules: check module force install#368

Open
jjmaksoud wants to merge 1 commit intoodoo:masterfrom
odoo-dev:master-track-force-install-maji
Open

[ADD] modules: check module force install#368
jjmaksoud wants to merge 1 commit intoodoo:masterfrom
odoo-dev:master-track-force-install-maji

Conversation

@jjmaksoud
Copy link
Copy Markdown
Contributor

Add a utility function to check if a given module was force installed during the upgrade.
This can be useful when a module is force installed and another module upgrade scripts need to fill in some data for it.

@robodoo
Copy link
Copy Markdown
Contributor

robodoo commented Dec 11, 2025

Pull request status dashboard

@jjmaksoud
Copy link
Copy Markdown
Contributor Author

upgradeci retry with always only base

@jjmaksoud jjmaksoud requested review from a team and asno-odoo December 11, 2025 13:19
@jjmaksoud jjmaksoud force-pushed the master-track-force-install-maji branch from 0a2163e to ec6be07 Compare January 5, 2026 10:53
@jjmaksoud jjmaksoud force-pushed the master-track-force-install-maji branch from ec6be07 to 512a20c Compare January 13, 2026 10:11
@Pirols Pirols requested a review from a team January 27, 2026 16:28
@jjmaksoud jjmaksoud force-pushed the master-track-force-install-maji branch from 512a20c to 2e585bf Compare January 28, 2026 16:45
@cawo-odoo cawo-odoo requested a review from KangOl February 3, 2026 14:49
Comment on lines +679 to 681
ENVIRON["__force_installed_modules"].update(toinstall)

if module in toinstall:
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't we track the module only if it has actually been marked as "to install"?

Suggested change
ENVIRON["__force_installed_modules"].update(toinstall)
if module in toinstall:
if module in toinstall:
ENVIRON["__force_installed_modules"].update(toinstall)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the toinstall list is a result of the previous query which set the state of the module and its dependencies. doesnt this mean they are actually marked as to install?

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

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe check if the module is still marked "to install".

Suggested change
return module in ENVIRON["__force_installed_modules"]
return module in ENVIRON["__force_installed_modules"] and module_installed(cr, module)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 would be useful in case a specific fix script reverted the installation of some modules

Add a utility function to check if a given module
was force installed during the upgrade.
This can be useful when a module is force installed
and another module upgrade scripts need to fill in
some data for it.
@jjmaksoud jjmaksoud force-pushed the master-track-force-install-maji branch from 2e585bf to a81a7ef Compare February 3, 2026 16:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants