[19] Question: migration of module_change_auto_install to Odoo 19
Hello OCA team,
We are migrating to Odoo 19 and noticed that module_change_auto_install no longer takes effect when listed in server_wide_modules. In 18.0 it worked fine.
Root cause observed
- In Odoo 19, the manifest pipeline moved to the new Manifest API.
- Patching odoo.modules.module.load_manifest (as in 18) no longer intercepts manifest parsing.
Working approach we implemented locally
- Hook odoo.modules.module._load_manifest and apply the same auto_install enable/disable overrides there.
- Keep reading settings from config/env (modules_auto_install_disabled / modules_auto_install_enabled).
- Removed <=18 compatibility in our patch to keep it 19-only.
Key details
- We set auto_install to False for disabled modules and to the set of dependencies (or empty set) for enabled modules, following Odoo 19’s rules (triggers must be dependencies now).
- On startup we log e.g.: “Hooked odoo.modules.module._load_manifest (Odoo 19+)” and per-module changes.
Questions
- Is targeting _load_manifest the right hook for Odoo 19 in this addon? Any preferred alternative?
- Could you please advise on the correct target branch for a PR? I don’t currently see/track a 19.0 branch for server-tools module_change_auto_install. If you create/confirm the 19.0 branch, I can open a PR right away.
Testing
- We used Odoo’s test harness with --test-enable / --test-tags on a fresh DB to validate basic manifest reading and config parsing.
Happy to contribute the patch and minimal doc note about the Odoo 19 behavior change (auto-install triggers must be declared dependencies).
Thanks!
— Milan Topuzov
Hi. Interesting topic. Could you better open a PR, once V19 is available, to understand better the diff ?
Thanks !
@legalsylvain Will do. I am waiting on several other OCA repositories to create the version 19 branches and I will issue PR's for several modules.
Thanks for your time as well!
Here is a PR https://github.com/OCA/server-tools/pull/3384 with tests added to validate the functionality