Skip to Content
Menu
Dette spørgsmål er blevet anmeldt

Hello, 


I am trying to upgrade from odoo17 to odoo18 on odoo.sh the upgrade is on the last stage awaiting a commit so it works the problem is that it is showing the following error

odoo.modules.loading: Some modules have inconsistent states, some dependencies may be missing: ['module-x', 'module-y'] "i used fake names for the modules".

the thing is both these modules are not part of the modules i added nor they exists in the original odoo addons i tried looking every possible reference of them using grep in the shell but there is no reference of them anyware except in the log entry and they dont exist in the custom code files. Is there a way to force the update to work despite this error?

Avatar
Kassér
Bedste svar

Hi,


The error occurs because Odoo still detects modules in the database (ir_module_module) that are marked as installed or present, even though they no longer exist in your code. These leftover references can happen if a module was removed without proper uninstallation, or if branches or upgrades changed the addons path. Odoo reads these database records before the upgrade, which is why it reports missing dependencies even though the code doesn’t contain them.


Searching your codebase with grep won’t help because the problem resides in the database metadata, not the files. Tables like ir_module_module, ir_module_module_dependency, and ir_model_data store module states, dependencies, and module-specific data. Missing modules in these tables can block upgrades.


The recommended solution is to mark the missing modules as uninstalled directly in the database, for example by updating ir_module_module or removing leftover dependency and data entries. Alternatively, you could temporarily add dummy modules with the same names to satisfy Odoo and then uninstall them properly. After these steps, running an update (-u all) will allow the upgrade to proceed.


Direct SQL manipulation should be done carefully with a backup, as it ensures database integrity and prevents upgrade failures. Once the database no longer references the missing modules, the upgrade to Odoo 18 should complete successfully.


Hope it helps

Avatar
Kassér
Forfatter

Hi
Thanks for the reply adding dummy modules worked
but now the upgrade is always waiting for user commit if i exit upgrade mode the branch reverts back to odoo17 is this normal?

Bedste svar

Hello,

The reason for such error could be that, the database still expects these modules exist (their records are in ir_module_module), But the actual source code for these modules doesn’t exist anymore in your repo or Odoo core. During upgrade, Odoo tries to check dependencies and can’t find those that fails to proceed.


How did that happened , following could be the cases:

- This could happen due to the module used to exist in your custom addons in v17 but was deleted/renamed before upgrading.

- The module was part of another dependency (e.g., website_*, crm_*, pos_*) that changed structure in v18.

- The module was referenced as a dependency (depends in __manifest__.py) of another module, but that dependency module was removed in v18.

- The module entries remain in ir_module_module table, even though the code is gone.


What you could still check:

Run the below query in the database of v17,

SELECT id, state name FROM ir_module_module where name::text in ('module_x', 'module_y');

If the modules exist in the db then ,if you get records you can safely mark them as uninstalled manually before restarting the upgrade, using the query below:

UPDATE ir_module_module SET state = 'uninstalled' WHERE id in (id_x, id_y);

Once updated, try again your upgrade.

Hope it helps


Avatar
Kassér
Related Posts Besvarelser Visninger Aktivitet
0
aug. 23
1884
2
jun. 20
7162
0
nov. 19
4801
2
nov. 19
3416
0
maj 17
3669