OpenUpgrade icon indicating copy to clipboard operation
OpenUpgrade copied to clipboard

Support Deleted Modules into apriori.py

Open mathben opened this issue 4 months ago • 10 comments

I am working to automate migration with OpenUpgrade.

By example with Odoo 17, the information about deleting modules is only accessible into file : https://github.com/OCA/OpenUpgrade/blob/17.0/docsource/modules160-170.rst

But this information is not into Python file like apriori.py : https://github.com/OCA/OpenUpgrade/blob/17.0/openupgrade_scripts/apriori.py

Like :

# only used here for upgrade_analysis
deleted_modules = [
    # odoo
    "l10n_ae_pos",
    "l10n_it_edi_pa",
    "l10n_lu_peppol_id",
    "l10n_pl_jpk",
    "website_payment_paypal"
]

This can be useful to ignore missing module. OpenUpgrade work correctly.

What do you think?

mathben avatar Aug 23 '25 06:08 mathben

In thé concept, i'm not against adding such info.

Could you explain how you will use this information ? (With link to the project if possible)

legalsylvain avatar Aug 23 '25 08:08 legalsylvain

In principle, I'm against this, as you have to be aware about missing modules for taking the corresponding actions. If the modules have been merged into another, then you already have the tool in the merged_modules section. If the module is really missing because the feature has been lost, then it should appear, and you finally uninstall it, or find an alternative. Example: this module disappears in 17.0, so we saw it and migrate it inside OCA.

pedrobaeza avatar Aug 23 '25 08:08 pedrobaeza

Note that the migration doesn't stop having missing modules.

pedrobaeza avatar Aug 23 '25 08:08 pedrobaeza

Here is the commit in which I use the variable "deleted_modules" : https://github.com/ERPLibre/ERPLibre/commit/247b4684216af561fb613fecf4380f23fe87e8e3

I am creating a migration procedure by automating the technical decisions at the time fo migration. This information allows me to validate that the module exists in the update environment. I exclude the module from the error list if it is in this deprecated list.

Example, "google_drive" is deprecated because its API was abandonned on 3rd October 2022. https://github.com/odoo/odoo/blob/15.0/addons/google_drive/models/google_drive.py#L21

We have no trace about it into file apriori.py https://github.com/OCA/OpenUpgrade/blob/16.0/openupgrade_scripts/apriori.py

The information is here : https://github.com/ERPLibre/OpenUpgrade/blob/16.0/docsource/modules150-160.rst I can extract it with a GPT, but it's more easy from apriori.py. Or maybe we can generate apriory.py from docsource to reduce redondance?

 Note that the migration doesn't stop having missing modules.

I propose to add only official OCA deprecated module into this list.

This is the list I found for now, I will do more test in few days. Would you like some pull requests?

Odoo 12.0

# Deleted modules
deleted_modules = [
    # odoo
    "anonymization",
    "l10n_be_intrastat",
    "l10n_be_intrastat_2019",
    "pos_data_drinks",
    "report_intrastat",
    "website_forum_doc",
    # OCA/...
]

Odoo 13.0

# Deleted modules
deleted_modules = [
    # odoo
    "hw_posbox_upgrade",
    "l10n_be_hr_payroll",
    "l10n_be_hr_payroll_account",
    "l10n_be_hr_payroll_fleet",
    "l10n_fr_hr_payroll",
    "l10n_in_hr_payroll",
    "l10n_in_schedule6",
    "website_hr",
    # OCA/...
]

Odoo 14.0

# Deleted modules
deleted_modules = [
    # odoo
    "base_gengo",
    "im_support",
    "l10n_cn_standard",
    "theme_bootswatch",
    "web_diagram",
    "website_gengo",
    # OCA/...
]

Odoo 15.0

# Deleted modules
deleted_modules = [
    # odoo
    "adyen_platforms",
    "l10n_bg",
    "l10n_ch_qriban",
    "odoo_referral",
    "payment_odoo_by_adyen",
    # OCA/...
]

Odoo 16.0

# Deleted modules
deleted_modules = [
    # odoo
    "google_drive",
    "google_spreadsheet",
    "l10n_it_edi_sdicoop",
    "l10n_sa_invoice",
    "payment_alipay",
    "payment_ogone",
    "payment_payulatam",
    "payment_payumoney",
    # OCA/...
]

Odoo 17.0

# Deleted modules
deleted_modules = [
    # odoo
    "l10n_ae_pos",
    "l10n_it_edi_pa",
    "l10n_lu_peppol_id",
    "l10n_pl_jpk",
    "website_payment_paypal",
    # OCA/...
]

Odoo 18.0

# Deleted modules
deleted_modules = [
    # odoo
    "pos_mercury",
    "spreadsheet_dashboard_purchase",
    "spreadsheet_dashboard_purchase_stock",
    "website_twitter",
    # OCA/...
]

mathben avatar Aug 23 '25 10:08 mathben

This could be useful if used by OpenUpgrade, but if it's only used in other softwares it can be misleading as we cannot be sure it's updated.

Anyway, if your goal is to automate OpenUpgrade work, there is already some working option: https://pypi.org/project/odoo-openupgrade-wizard/ , which works from command-line, and /ads on/ my https://github.com/efatto/openupgrader/ /ads off/, which works from inside Odoo.

There will be a round table at next OCA Days on this matter too.

sergiocorato avatar Aug 26 '25 06:08 sergiocorato

I have mixed feelings :

This could be useful if used by OpenUpgrade, but if it's only used in other softwares it can be misleading as we cannot be sure it's updated.

Quite agree with that.

In the meantime, deleted_modules can be generated at the beginning of an Openupgrade release, quite easely. Then, this list is like a todo list :

  • some modules will move into the renamed / merged list after analysis.
  • some odoo modules will land in an OCA repo, so it will be put in renamed list also.
  • finally, the remaining list is really the list of modules abandonned. (like web_diagram for exemple)

What I like in adding that list in Openupgrade is that it avoids each openupgrade user to ask himself what to do. I mean, I wondered what to do with web_diagram (https://github.com/OCA/OpenUpgrade/pull/3232), Then, @etobella wondered what to do with web_diagram (https://github.com/OCA/OpenUpgrade/pull/3615)).

Other people have surely asked themselves the same question.

Extra Idea : we could add an optional script, that uninstall automatically the deleted modules. Something like if os.environ.get("OPENUPGRADE_UNINSTALL_DELETED_MODULES", "") == "yes":

CC : @etobella

Finally, I'm quite in favor of adding this list in Openupgrade, with explanation. For me, it doesn't hurt. Do you think it's acceptable, @pedrobaeza ?

Something like :

# Here is the list of Odoo CE modules that disappeared in the 14.0 version
# If a module is finally recovered in an OCA repo, please remove the entry here
# (or put it in the renamed_modules list, if the moduel has been renamed.
# This list is not used for the time being, but is used by extra tools
# See : https://github.com/OCA/OpenUpgrade/issues/5336

# OR : 

# This list is used in the end-migration.py, this modules will be uninstalled, if
# OPENUPGRADE_UNINSTALL_DELETED_MODULES is set to 'yes'
deleted_modules  = [
    "web_diagram",
]

Note : However, I am against listing the OCA modules. (Only the list of Odoo CE modules.) OCA, is like 10000 modules, and port the modules are done lately, monthes or years after the release. So the list will be allways wrong, regarding OCA modules. (only Odoo CE modules are stable, once the release is done). Also a lot of modules doesn't exist in intermediate version, but exists again, 2 or 4 versions later.

What do you think @mathben ?

legalsylvain avatar Aug 26 '25 09:08 legalsylvain

The problem I see is that at the end, this is more charge for OpenUpgrade maintainers, as the rest of OCA is not going to maintain this for sure (not with bad intentions, but due to unacknowledged).

pedrobaeza avatar Aug 26 '25 09:08 pedrobaeza

The problem I see is that at the end, this is more charge for OpenUpgrade maintainers, as the rest of OCA is not going to maintain this for sure (not with bad intentions, but due to unacknowledged).

I don't think this list will require a lot of maintenance. Don't you think ? See https://github.com/OCA/OpenUpgrade/pulls?q=is%3Apr+is%3Aopen+Deleted PRs : The list are quite stable. Or did I missed something ? If yes, could you elaborate.

If I understand correctly, for exemple, regarding your recent job regarding spreadsheet_dashboard_purchase_oca (https://github.com/OCA/spreadsheet/pull/67)

For the time being :

Before your work renamed_modules = []

After your PR is merged renamed_modules = ["spreadsheet_dashboard_purchase", "spreadsheet_dashboard_purchase_oca"]

What @mathben propose

Before your work renamed_modules = [] deleted_modules = ["spreadsheet_dashboard_purchase"]

After your PR is merged renamed_modules = ["spreadsheet_dashboard_purchase", "spreadsheet_dashboard_purchase_oca"] deleted_modules = []

I don't see more work.

Thanks for your clarification.

legalsylvain avatar Aug 26 '25 20:08 legalsylvain

Well, that's because I'm the same person is maintaining OpenUpgrade and the corresponding OCA modules. In other cases, the person won't match and the list will be outdated, but I'm not blocking this.

pedrobaeza avatar Aug 27 '25 06:08 pedrobaeza

This is the list I found for now, I will do more test in few days. Would you like some pull requests?

I think some of them are merged into other modules. I will need to check.

MiquelRForgeFlow avatar Aug 31 '25 14:08 MiquelRForgeFlow