Skip to Content
Menu
This question has been flagged
5 Replies
4864 Views

Hello,
We are performing upgrade tests from version 12.0 to version 15.0 for a database hosted on Odoo.sh and we are getting the following error message:



In this particular database we have several custom modules that are no longer necessary in the new version to which we want to move, so before sending the database to the upgrade service we proceeded to uninstall them and remove them from the repository (all this in a staging branch ).


According to the documentation:

Custom modules in the upgraded database are set to be updated. If the modules are missing in the code, the update fails.


Indeed, although the modules were uninstalled and removed, when the database is imported again after the upgrade process, they are still present and marked as To be upgraded:




And due to the sources were previously removed we are getting the following error message:


2023-01-11 14:40:55,043 14 ERROR pentagonia-testing-6899333 odoo.modules.loading: Some modules have inconsistent states, some dependencies may be missing: ['deltatech_alternative', ...]


My question is: Is there a way to mark custom modules as To be removed to avoid the update attempt after the database import process?


Thanks in advance


Avatar
Discard
Best Answer

Hi Alexander: One step is missing in the module cleanup steps listed. In addition to uninstalling and removing from the repository, you also need to go to Apps and delete the module from the list of apps listed. That should ensure that it will not get picked up by the upgrade process.

Avatar
Discard
Best Answer

Alexander, did you find any answer? We're running into the same situation and scratching our heads...

Avatar
Discard
Author

Hi, according to the documentation:
"The latest production daily automatic backup is sent to the upgrade platform to start the upgrade test process."

Therefore, regardless of what you do on the staging branch, the backup that is sent to the upgrade service is the latest available daily backup.

In our particular case, we had many modules that were already deprecated, so we chose to do the process by sending the database manually from upgrade.odoo.com

https://www.odoo.com/documentation/master/administration/upgrade/odoo_sh.html#upgrade-your-database-on-a-staging-branch

Regards

Author Best Answer

Hello Paresh,

Although I didn't mention it, I certainly also removed the modules from the app list right after uninstalling and removing them from the repository.

Regards

Avatar
Discard
Best Answer

Same issue here ...

As on odoo.sh it always starts from a nightly backup from your production database, you have to include the uninstall in your upgrade scripts:


Like i used this:

import logging
from odoo.upgrade import util


_logger = logging.getLogger(__name__)


def migrate(cr, version):
   
    modules_to_uninstall = [
        'mollie_account_sync',
        'payment_mollie_official',
        'product_harmonized_system',
        'product_harmonized_system_delivery',
        'product_harmonized_system_stock'
    ]

    for candidate in modules_to_uninstall:
        _logger.info("About to uninstall module %s", candidate)
        util.remove_module(cr,candidate)


Read more about update utils here:

https://www.odoo.com/documentation/17.0/developer/reference/upgrade_utils.html

Avatar
Discard
Best Answer

Make a copy of database of the same original version(12),uninstall those modules there,then import this database to odoo15,this will ensure those modules will not be installed in the new odoo15 database.
NOTE : make sure other modules don't have dependencies.

Avatar
Discard
Related Posts Replies Views Activity
1
May 24
1234
1
Jun 22
5418
0
Jan 24
867
1
Dec 23
1720
1
Jun 25
657