diff --git a/openupgrade_scripts/apriori.py b/openupgrade_scripts/apriori.py index cd3d3a9a9ec2..18579ba763fb 100644 --- a/openupgrade_scripts/apriori.py +++ b/openupgrade_scripts/apriori.py @@ -143,6 +143,18 @@ # OCA/... } +# Deleted modules +deleted_modules = [ + # odoo + "base_gengo", + "im_support", + "l10n_cn_standard", + "theme_bootswatch", + "web_diagram", + "website_gengo", + # OCA/... +] + # only used here for upgrade_analysis renamed_models = { # odoo diff --git a/openupgrade_scripts/scripts/om_account_accountant/14.0.8.1.0/pre-migration.py b/openupgrade_scripts/scripts/om_account_accountant/14.0.8.1.0/pre-migration.py new file mode 100644 index 000000000000..ba3427bba025 --- /dev/null +++ b/openupgrade_scripts/scripts/om_account_accountant/14.0.8.1.0/pre-migration.py @@ -0,0 +1,38 @@ +# Copyright 2025 TechnoLibre +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). +import logging + +from openupgradelib import openupgrade + +from odoo.tools.translate import _ + +_logger = logging.getLogger(__name__) + + +def change_owner_group_fiscal_year(env): + """When installing om_account_accountant, got a conflict duplicated group group_fiscal_year""" + imd = env["ir.model.data"].sudo() + # Remove any stale/duplicate mapping of the old XMLID + imd.search( + [ + ("module", "=", "account"), + ("name", "=", "group_fiscal_year"), + ("model", "=", "res.groups"), + ] + ).unlink() + imd = env["res.groups"].sudo() + # Remove any stale/duplicate mapping of the old XMLID + imd.search( + [ + ( + "name", + "=", + "Allow to define fiscal years of more or less than a year", + ), + ] + ).unlink() + + +@openupgrade.migrate() +def migrate(env, version): + change_owner_group_fiscal_year(env)