From 9fef207382e03427f9306bd03039d5aa4f14128b Mon Sep 17 00:00:00 2001 From: Guillaume MASSON Date: Fri, 18 Aug 2023 11:30:08 +0200 Subject: [PATCH 01/51] [16.0][FIX] openupgrade_framework : end-migration scripts are forced to run at install too Fixes OCA/OpenUpgrade#4106 --- openupgrade_framework/odoo_patch/odoo/modules/migration.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/openupgrade_framework/odoo_patch/odoo/modules/migration.py b/openupgrade_framework/odoo_patch/odoo/modules/migration.py index 872f84817eb2..2ceda215d03d 100644 --- a/openupgrade_framework/odoo_patch/odoo/modules/migration.py +++ b/openupgrade_framework/odoo_patch/odoo/modules/migration.py @@ -15,9 +15,14 @@ def migrate_module(self, pkg, stage): to_install = pkg.state == "to install" if to_install: pkg.state = "to upgrade" + load_state_to_install = getattr(pkg, "load_state", False) + if load_state_to_install == "to install": + pkg.load_state = "to upgrade" MigrationManager.migrate_module._original_method(self, pkg, stage) if to_install: pkg.state = "to install" + if load_state_to_install == "to install": + pkg.load_state = "to install" migrate_module._original_method = MigrationManager.migrate_module From c2f89a615f16a5e044e236ec6f6ddebec50a19fc Mon Sep 17 00:00:00 2001 From: Guillaume MASSON Date: Fri, 25 Aug 2023 16:19:08 +0200 Subject: [PATCH 02/51] =?UTF-8?q?[IMP]=C2=A0add=20tests=20for=20end=20migr?= =?UTF-8?q?ation=20scripts=20for=20newly=20installed=20modules?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/test.yml | 6 ++++++ .../scripts/base/16.0.1.3/tests/__init__.py | 1 + .../base/16.0.1.3/tests/end-migration_test.py | 14 ++++++++++++++ .../tests/test_newly_installed_end_migration.py | 10 ++++++++++ 4 files changed, 31 insertions(+) create mode 100644 openupgrade_scripts/scripts/base/16.0.1.3/tests/end-migration_test.py create mode 100644 openupgrade_scripts/scripts/base/16.0.1.3/tests/test_newly_installed_end_migration.py diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 806c72fe4475..5457938dc86b 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -95,6 +95,12 @@ jobs: for snippet in openupgrade/openupgrade_scripts/scripts/*/*/tests/data*.py; do odoo-old/odoo-bin shell -d $DB < $snippet done + - name: Test end-migration script for newly installed module (i.e. "spreadsheet" for v16) + run: | + END_SCRIPT_TEST=openupgrade/openupgrade_scripts/scripts/base/16.0.1.3/tests/end-migration_test.py + NEW_MODULE_SCRIPT_DIR=openupgrade/openupgrade_scripts/scripts/spreadsheet/16.0.1.0/ + mkdir -p $NEW_MODULE_SCRIPT_DIR + cp $END_SCRIPT_TEST $NEW_MODULE_SCRIPT_DIR - name: OpenUpgrade test run: | # select modules and perform the upgrade diff --git a/openupgrade_scripts/scripts/base/16.0.1.3/tests/__init__.py b/openupgrade_scripts/scripts/base/16.0.1.3/tests/__init__.py index 8e84cc263319..aa4adee7d02e 100644 --- a/openupgrade_scripts/scripts/base/16.0.1.3/tests/__init__.py +++ b/openupgrade_scripts/scripts/base/16.0.1.3/tests/__init__.py @@ -1 +1,2 @@ from . import test_base_migration +from . import test_newly_installed_end_migration diff --git a/openupgrade_scripts/scripts/base/16.0.1.3/tests/end-migration_test.py b/openupgrade_scripts/scripts/base/16.0.1.3/tests/end-migration_test.py new file mode 100644 index 000000000000..d28d5562205b --- /dev/null +++ b/openupgrade_scripts/scripts/base/16.0.1.3/tests/end-migration_test.py @@ -0,0 +1,14 @@ +# Copyright 2023 Odoo Community Association (OCA) +# Copyright 2023 Guillaume Masson +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). +import logging + +from openupgradelib import openupgrade + +_logger = logging.getLogger(__name__) + + +@openupgrade.migrate(no_version=True) +def migrate(env, version): + params = env["ir.config_parameter"].sudo() + params.set_param("openupgrade.test_end_migration", "Executed") diff --git a/openupgrade_scripts/scripts/base/16.0.1.3/tests/test_newly_installed_end_migration.py b/openupgrade_scripts/scripts/base/16.0.1.3/tests/test_newly_installed_end_migration.py new file mode 100644 index 000000000000..4e722769eb73 --- /dev/null +++ b/openupgrade_scripts/scripts/base/16.0.1.3/tests/test_newly_installed_end_migration.py @@ -0,0 +1,10 @@ +from odoo.tests import TransactionCase, tagged + + +@tagged("-at_install", "post_install") +class TestNewlyInstalledEndMigration(TransactionCase): + def test_newly_installed_end_migration(self): + """Make sure the code of the end-migration script has been executed""" + params = self.env["ir.config_parameter"].sudo() + res = params.get_param("openupgrade.test_end_migration", default="Not executed") + self.assertEqual(res, "Executed") From a3ad7019569109ca0bab96b466c849893e584db6 Mon Sep 17 00:00:00 2001 From: Enric Tobella Date: Thu, 20 Mar 2025 23:38:02 +0100 Subject: [PATCH 03/51] [OU-ADD] base_address_extended --- .../16.0.1.1/pre-migration.py | 58 +++++++++++++++++++ 1 file changed, 58 insertions(+) create mode 100644 openupgrade_scripts/scripts/base_address_extended/16.0.1.1/pre-migration.py diff --git a/openupgrade_scripts/scripts/base_address_extended/16.0.1.1/pre-migration.py b/openupgrade_scripts/scripts/base_address_extended/16.0.1.1/pre-migration.py new file mode 100644 index 000000000000..ca3a0368cf24 --- /dev/null +++ b/openupgrade_scripts/scripts/base_address_extended/16.0.1.1/pre-migration.py @@ -0,0 +1,58 @@ +# Copyright 2025 Dixmit +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). + +from openupgradelib import openupgrade + +_add_fields = [ + ( + "street_name", + "res.partner", + "res_partner", + "char", + None, + "base_address_extended", + None, + ), + ( + "street_number", + "res.partner", + "res_partner", + "char", + None, + "base_address_extended", + None, + ), + ( + "street_number2", + "res.partner", + "res_partner", + "char", + None, + "base_address_extended", + None, + ), +] + + +@openupgrade.migrate() +def migrate(env, _version): + openupgrade.add_fields(env, _add_fields) + # We need to use the subquery because the regex is not allowed inside the UPDATE statement + openupgrade.logged_query( + env.cr, + """ + UPDATE res_partner + SET + street_name = TRIM(rgx[1]), + street_number = TRIM(rgx[2]), + street_number2 = TRIM(rgx[3]) + FROM ( + SELECT + id, + regexp_match(street, '^(.*?)(?:\\s([0-9][0-9\\S]*))?(?: - (.+))?$') AS rgx + FROM res_partner + WHERE street IS NOT NULL + ) AS sub + WHERE res_partner.id = sub.id; + """, + ) From e79737d23a7fcf21f03c696c20ac741526aa686d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miquel=20Ra=C3=AFch?= Date: Wed, 26 Mar 2025 11:13:33 +0100 Subject: [PATCH 04/51] [IMP] docsource: mark base_address_extended as done --- docsource/modules150-160.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docsource/modules150-160.rst b/docsource/modules150-160.rst index 55be4b13cbc8..61bc25490e07 100644 --- a/docsource/modules150-160.rst +++ b/docsource/modules150-160.rst @@ -76,7 +76,7 @@ Module coverage 15.0 -> 16.0 +-------------------------------------------------+----------------------+-------------------------------------------------+ | |del| base_address_city | |Merged into base_address_extended. | +-------------------------------------------------+----------------------+-------------------------------------------------+ -| base_address_extended | Nothing to do | | +| base_address_extended | Done | | +-------------------------------------------------+----------------------+-------------------------------------------------+ | base_automation | Nothing to do |No DB layout changes. | +-------------------------------------------------+----------------------+-------------------------------------------------+ From ea113b56d71a28ab7a7ee7fb30a58d8d67a03148 Mon Sep 17 00:00:00 2001 From: Enric Tobella Date: Sat, 29 Mar 2025 19:54:36 +0100 Subject: [PATCH 05/51] [OU-ADD] l10n_es: Add migration stcripts for the merge of IRNR taxes to Spanish localization --- .../l10n_es/16.0.5.3/post-migration.py | 25 +++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 openupgrade_scripts/scripts/l10n_es/16.0.5.3/post-migration.py diff --git a/openupgrade_scripts/scripts/l10n_es/16.0.5.3/post-migration.py b/openupgrade_scripts/scripts/l10n_es/16.0.5.3/post-migration.py new file mode 100644 index 000000000000..21c4fb13bb05 --- /dev/null +++ b/openupgrade_scripts/scripts/l10n_es/16.0.5.3/post-migration.py @@ -0,0 +1,25 @@ +# Copyright 2025 Dixmit +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). + + +from openupgradelib import openupgrade + +IRNR_TAX_GROUP_MAP = { + "l10n_es.%s_account_tax_template_s_irpfnrnue24": "l10n_es.tax_group_retenciones_24", + "l10n_es.%s_account_tax_template_p_irpfnrnue24p": "l10n_es.tax_group_retenciones_24", + "l10n_es.%s_account_tax_template_s_irpfnrue19": "l10n_es.tax_group_retenciones_19", + "l10n_es.%s_account_tax_template_p_irpfnrue19p": "l10n_es.tax_group_retenciones_19", + "l10n_es.%s_account_tax_template_s_irpfnrnue0": "l10n_es.tax_group_retenciones_0", + "l10n_es.%s_account_tax_template_p_irpfnrnue0p": "l10n_es.tax_group_retenciones_0", + "l10n_es.%s_account_tax_template_s_irpfnrue0": "l10n_es.tax_group_retenciones_0", + "l10n_es.%s_account_tax_template_p_irpfnrue0p": "l10n_es.tax_group_retenciones_0", +} + + +@openupgrade.migrate() +def migrate(env, version): + for company in env["res.company"].search([]): + for irnr_tax_ref in IRNR_TAX_GROUP_MAP: + irnr_tax = env.ref(irnr_tax_ref % company.id, raise_if_not_found=False) + if irnr_tax: + irnr_tax.tax_group_id = env.ref(IRNR_TAX_GROUP_MAP[irnr_tax_ref]) From 4bc61a8ae6c1a14e940575efc8ebf4f2b4e99cd9 Mon Sep 17 00:00:00 2001 From: Holger Brunn Date: Mon, 31 Mar 2025 13:28:52 +0200 Subject: [PATCH 06/51] [IMP] pin random github actions to their SHA commit --- .github/workflows/documentation-commit.yml | 2 +- .github/workflows/test.yml | 21 +++++++++++---------- 2 files changed, 12 insertions(+), 11 deletions(-) diff --git a/.github/workflows/documentation-commit.yml b/.github/workflows/documentation-commit.yml index e8539577ce6b..d09f8178a470 100644 --- a/.github/workflows/documentation-commit.yml +++ b/.github/workflows/documentation-commit.yml @@ -60,7 +60,7 @@ jobs: # try to build the documentation sh ./build_openupgrade_docs - name: Commit changes - uses: EndBug/add-and-commit@v9 + uses: EndBug/add-and-commit@a94899bca583c204427a224a7af87c02f9b325d5 #v9 with: add: "docs" default_author: github_actions diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index f2ea662ca39c..2da78e236dd1 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -25,21 +25,22 @@ jobs: PGPASSWORD: "odoo" PGUSER: "odoo" OPENUPGRADE_USE_DEMO: "yes" + services: + postgres: + image: postgres:14.0 + env: + POSTGRES_USER: odoo + POSTGRES_PASSWORD: odoo + POSTGRES_DB: odoo + ports: + - 5432:5432 steps: - name: Set up Python uses: actions/setup-python@v5 with: python-version: '3.10' - - name: Configure Postgres - uses: harmon758/postgresql-action@v1 - with: - postgresql version: "14" - postgresql user: ${DB_USERNAME} - postgresql password: ${DB_PASSWORD} - - name: Wait / Sleep - uses: jakejarvis/wait-action@v0.1.0 - with: - time: "10s" + - name: Sleep for 10 seconds + run: sleep 10s - name: DB Creation run: createdb $DB - name: DB Restore From 0570f5514c2b4d3e2c18171469ca54256c17e0a3 Mon Sep 17 00:00:00 2001 From: Carlos Roca Date: Tue, 1 Apr 2025 11:36:52 +0200 Subject: [PATCH 07/51] [OU-ADD] account_check_printing: Nothing to do --- docsource/modules150-160.rst | 2 +- .../16.0.1.0/upgrade_analysis_work.txt | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) create mode 100644 openupgrade_scripts/scripts/account_check_printing/16.0.1.0/upgrade_analysis_work.txt diff --git a/docsource/modules150-160.rst b/docsource/modules150-160.rst index 61bc25490e07..23f0d27ff087 100644 --- a/docsource/modules150-160.rst +++ b/docsource/modules150-160.rst @@ -8,7 +8,7 @@ Module coverage 15.0 -> 16.0 +=================================================+======================+=================================================+ | account |Done | | +-------------------------------------------------+----------------------+-------------------------------------------------+ -| account_check_printing | |No DB layout changes. | +| account_check_printing | Nothing to do |No DB layout changes. | +-------------------------------------------------+----------------------+-------------------------------------------------+ | account_debit_note | Nothing to do |No DB layout changes. | +-------------------------------------------------+----------------------+-------------------------------------------------+ diff --git a/openupgrade_scripts/scripts/account_check_printing/16.0.1.0/upgrade_analysis_work.txt b/openupgrade_scripts/scripts/account_check_printing/16.0.1.0/upgrade_analysis_work.txt new file mode 100644 index 000000000000..fee818c6f894 --- /dev/null +++ b/openupgrade_scripts/scripts/account_check_printing/16.0.1.0/upgrade_analysis_work.txt @@ -0,0 +1,5 @@ +---Models in module 'account_check_printing'--- +---Fields in module 'account_check_printing'--- +---XML records in module 'account_check_printing'--- +---nothing has changed in this module-- +# NOTHING TO DO From 14f0f89c6731877a36f699756c0f1c9040ae22a6 Mon Sep 17 00:00:00 2001 From: Carlos Lopez Date: Tue, 1 Apr 2025 11:04:56 -0500 Subject: [PATCH 08/51] [OU-FIX] sale_timesheet: Update security rule according to Odoo changes Complementary to https://github.com/odoo/odoo/pull/203460 --- .../scripts/sale_timesheet/16.0.1.0/noupdate_changes.xml | 8 ++++++++ .../scripts/sale_timesheet/16.0.1.0/pre-migration.py | 1 + 2 files changed, 9 insertions(+) create mode 100644 openupgrade_scripts/scripts/sale_timesheet/16.0.1.0/noupdate_changes.xml diff --git a/openupgrade_scripts/scripts/sale_timesheet/16.0.1.0/noupdate_changes.xml b/openupgrade_scripts/scripts/sale_timesheet/16.0.1.0/noupdate_changes.xml new file mode 100644 index 000000000000..7ccd52fce3c3 --- /dev/null +++ b/openupgrade_scripts/scripts/sale_timesheet/16.0.1.0/noupdate_changes.xml @@ -0,0 +1,8 @@ + + + + + [('project_id', '=', False)] + + diff --git a/openupgrade_scripts/scripts/sale_timesheet/16.0.1.0/pre-migration.py b/openupgrade_scripts/scripts/sale_timesheet/16.0.1.0/pre-migration.py index 8d92a1fef264..3632a3a246ed 100644 --- a/openupgrade_scripts/scripts/sale_timesheet/16.0.1.0/pre-migration.py +++ b/openupgrade_scripts/scripts/sale_timesheet/16.0.1.0/pre-migration.py @@ -29,6 +29,7 @@ def _update_account_analytic_line_timesheet_invoice_type(env): @openupgrade.migrate() def migrate(env, version): + openupgrade.load_data(env.cr, "sale_timesheet", "16.0.1.0/noupdate_changes.xml") _update_account_analytic_line_timesheet_invoice_type(env) # Remove SQL view project_profitability_report not used anymore in Odoo 16 openupgrade.logged_query( From a9d7ff2dedab7dbb3758cd28673f542cfa352d74 Mon Sep 17 00:00:00 2001 From: pilarvargas-tecnativa Date: Thu, 10 Apr 2025 07:59:36 +0200 Subject: [PATCH 09/51] [OU-ADD] survey_placeholder: Merge into survey TT51954 --- openupgrade_scripts/apriori.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/openupgrade_scripts/apriori.py b/openupgrade_scripts/apriori.py index 890dd90e2eab..1a3b84e6ae34 100644 --- a/openupgrade_scripts/apriori.py +++ b/openupgrade_scripts/apriori.py @@ -123,6 +123,8 @@ "mail_preview_base": "mail", # OCA/stock-logistics-workflow "stock_picking_backorder_strategy": "stock", + # OCA/survey + "survey_placeholder": "survey", # OCA/web "web_drop_target": "web", "web_ir_actions_act_view_reload": "web", From e6121c1527ddcca7e129b8a754bce095106e5af6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Alix?= Date: Wed, 30 Apr 2025 08:58:12 +0200 Subject: [PATCH 10/51] [OU-ADD] apriori: 'product_packaging_type' renamed to 'product_packaging_level' --- openupgrade_scripts/apriori.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/openupgrade_scripts/apriori.py b/openupgrade_scripts/apriori.py index 1a3b84e6ae34..15bf9dc57742 100644 --- a/openupgrade_scripts/apriori.py +++ b/openupgrade_scripts/apriori.py @@ -34,6 +34,8 @@ "knowledge": "document_knowledge", # OCA/multi-company "res_partner_category_multi_company": "partner_category_multi_company", + # OCA/product-attribute + "product_packaging_type": "product_packaging_level", # OCA/project "project_stage_mgmt": "project_task_stage_mgmt", # OCA/sale-promotion From f57a29d82088f21e4dade48cbcb6e3d75544aca5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Alix?= Date: Wed, 30 Apr 2025 08:58:32 +0200 Subject: [PATCH 11/51] [OU-ADD] apriori: 'sale_by_packaging' renamed to 'sell_only_by_packaging' --- openupgrade_scripts/apriori.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/openupgrade_scripts/apriori.py b/openupgrade_scripts/apriori.py index 15bf9dc57742..a26aed544b31 100644 --- a/openupgrade_scripts/apriori.py +++ b/openupgrade_scripts/apriori.py @@ -53,6 +53,8 @@ "sale_coupon_partner": "sale_loyalty_partner", "website_sale_coupon_page": "website_sale_loyalty_page", "website_sale_coupon_selection_wizard": "website_sale_loyalty_suggestion_wizard", + # OCA/sale-workflow + "sale_by_packaging": "sell_only_by_packaging", # OCA/server-ux "mass_editing": "server_action_mass_edit", # OCA/l10n-italy From 0e022163883d3b8a87d384dab9db838f683a1cee Mon Sep 17 00:00:00 2001 From: Carlos Lopez Date: Tue, 6 May 2025 07:53:51 -0500 Subject: [PATCH 12/51] [OU-ADD] website_sale_slides: Migration to 16.0 --- docsource/modules150-160.rst | 2 +- .../16.0.1.0/pre-migration.py | 23 +++++++++++++++++++ .../16.0.1.0/upgrade_analysis_work.txt | 18 +++++++++++++++ 3 files changed, 42 insertions(+), 1 deletion(-) create mode 100644 openupgrade_scripts/scripts/website_sale_slides/16.0.1.0/pre-migration.py create mode 100644 openupgrade_scripts/scripts/website_sale_slides/16.0.1.0/upgrade_analysis_work.txt diff --git a/docsource/modules150-160.rst b/docsource/modules150-160.rst index 23f0d27ff087..e9529e620678 100644 --- a/docsource/modules150-160.rst +++ b/docsource/modules150-160.rst @@ -990,7 +990,7 @@ Module coverage 15.0 -> 16.0 +-------------------------------------------------+----------------------+-------------------------------------------------+ | website_sale_product_configurator | Nothing to do | | +-------------------------------------------------+----------------------+-------------------------------------------------+ -| website_sale_slides | | | +| website_sale_slides | Done | | +-------------------------------------------------+----------------------+-------------------------------------------------+ | website_sale_stock | Nothing to do | | +-------------------------------------------------+----------------------+-------------------------------------------------+ diff --git a/openupgrade_scripts/scripts/website_sale_slides/16.0.1.0/pre-migration.py b/openupgrade_scripts/scripts/website_sale_slides/16.0.1.0/pre-migration.py new file mode 100644 index 000000000000..7ac4b5a17189 --- /dev/null +++ b/openupgrade_scripts/scripts/website_sale_slides/16.0.1.0/pre-migration.py @@ -0,0 +1,23 @@ +# Copyright 2025 Tecnativa - Carlos Lopez +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). +from openupgradelib import openupgrade + + +def _update_detailed_type_to_course(env): + """ + Adapt all products using into a course to the new detailed_type=course + """ + openupgrade.logged_query( + env.cr, + """UPDATE product_template pt + SET detailed_type = 'course' + FROM product_product pp + JOIN slide_channel sc ON sc.product_id = pp.id + WHERE pp.product_tmpl_id = pt.id; + """, + ) + + +@openupgrade.migrate() +def migrate(env, version): + _update_detailed_type_to_course(env) diff --git a/openupgrade_scripts/scripts/website_sale_slides/16.0.1.0/upgrade_analysis_work.txt b/openupgrade_scripts/scripts/website_sale_slides/16.0.1.0/upgrade_analysis_work.txt new file mode 100644 index 000000000000..936115e82a1c --- /dev/null +++ b/openupgrade_scripts/scripts/website_sale_slides/16.0.1.0/upgrade_analysis_work.txt @@ -0,0 +1,18 @@ +---Models in module 'website_sale_slides'--- +---Fields in module 'website_sale_slides'--- +website_sale_slides / product.template / detailed_type (False) : previously in module gift_card +# DONE: pre-migration: Update detailed_type=course on products used in courses + +---XML records in module 'website_sale_slides'--- +NEW ir.ui.view: website_sale_slides.cart_summary_inherit_website_sale_slides +NEW ir.ui.view: website_sale_slides.course_join +NEW ir.ui.view: website_sale_slides.course_main +NEW ir.ui.view: website_sale_slides.course_purchased_confirmation_message +NEW ir.ui.view: website_sale_slides.slide_channel_view_form_add_inherit_sale_slides +NEW ir.ui.view: website_sale_slides.slide_channel_view_tree_report +NEW ir.ui.view: website_sale_slides.snippet_options +NEW ir.ui.view: website_sale_slides.website_sale_confirmation_slide +DEL ir.ui.view: website_sale_slides.course_sidebar +NEW product.category: website_sale_slides.product_category_courses +NEW product.product: website_sale_slides.default_product_course +# NOTHING TO DO: new features From f237b124ef5127bc32055a14a76dcf0a4d362f09 Mon Sep 17 00:00:00 2001 From: Carlos Lopez Date: Tue, 6 May 2025 09:47:33 -0500 Subject: [PATCH 13/51] [OU-ADD] mass_mailing_slides : Nothing to do --- docsource/modules150-160.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docsource/modules150-160.rst b/docsource/modules150-160.rst index 23f0d27ff087..2778f66209da 100644 --- a/docsource/modules150-160.rst +++ b/docsource/modules150-160.rst @@ -554,7 +554,7 @@ Module coverage 15.0 -> 16.0 +-------------------------------------------------+----------------------+-------------------------------------------------+ | mass_mailing_sale_sms | |No DB layout changes. | +-------------------------------------------------+----------------------+-------------------------------------------------+ -| mass_mailing_slides | | | +| mass_mailing_slides | Nothing to do | | +-------------------------------------------------+----------------------+-------------------------------------------------+ | mass_mailing_sms | |No DB layout changes. | +-------------------------------------------------+----------------------+-------------------------------------------------+ From 4fd61811fb4448ff26733148d99bd1e3fad07bc7 Mon Sep 17 00:00:00 2001 From: Carlos Lopez Date: Tue, 6 May 2025 11:28:58 -0500 Subject: [PATCH 14/51] [OU-ADD] sale_quotation_builder : Nothing to do --- docsource/modules150-160.rst | 2 +- .../sale_quotation_builder/16.0.1.0/noupdate_changes.xml | 1 + .../sale_quotation_builder/16.0.1.0/upgrade_analysis.txt | 2 ++ 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/docsource/modules150-160.rst b/docsource/modules150-160.rst index 23f0d27ff087..a1dbb03601c9 100644 --- a/docsource/modules150-160.rst +++ b/docsource/modules150-160.rst @@ -790,7 +790,7 @@ Module coverage 15.0 -> 16.0 +-------------------------------------------------+----------------------+-------------------------------------------------+ | sale_purchase_stock | Nothing to do | | +-------------------------------------------------+----------------------+-------------------------------------------------+ -| sale_quotation_builder | | | +| sale_quotation_builder | Nothing to do | | +-------------------------------------------------+----------------------+-------------------------------------------------+ | sale_sms | | | +-------------------------------------------------+----------------------+-------------------------------------------------+ diff --git a/openupgrade_scripts/scripts/sale_quotation_builder/16.0.1.0/noupdate_changes.xml b/openupgrade_scripts/scripts/sale_quotation_builder/16.0.1.0/noupdate_changes.xml index f070bee44fc6..15010d560ef7 100644 --- a/openupgrade_scripts/scripts/sale_quotation_builder/16.0.1.0/noupdate_changes.xml +++ b/openupgrade_scripts/scripts/sale_quotation_builder/16.0.1.0/noupdate_changes.xml @@ -1,5 +1,6 @@ +
diff --git a/openupgrade_scripts/scripts/sale_quotation_builder/16.0.1.0/upgrade_analysis.txt b/openupgrade_scripts/scripts/sale_quotation_builder/16.0.1.0/upgrade_analysis.txt index 337005f04eda..4aeed77c7742 100644 --- a/openupgrade_scripts/scripts/sale_quotation_builder/16.0.1.0/upgrade_analysis.txt +++ b/openupgrade_scripts/scripts/sale_quotation_builder/16.0.1.0/upgrade_analysis.txt @@ -2,4 +2,6 @@ ---Fields in module 'sale_quotation_builder'--- sale_quotation_builder / sale.order.template.line / website_description (html) : is now stored sale_quotation_builder / sale.order.template.line / website_description (html) : not related anymore +# NOTHING TO DO: quotation_description in product_template is store=False, so let the ORM recompute the field here. + ---XML records in module 'sale_quotation_builder'--- From 89fa306e0b88ddf18e86e1d0dc1c7b965eacf277 Mon Sep 17 00:00:00 2001 From: FernandoRomera Date: Wed, 7 May 2025 07:52:16 +0200 Subject: [PATCH 15/51] [16.0][OU-FIX] hr: create_work_contact skip partners without work_email and mobile_phone --- .../scripts/hr/16.0.1.1/post-migration.py | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/openupgrade_scripts/scripts/hr/16.0.1.1/post-migration.py b/openupgrade_scripts/scripts/hr/16.0.1.1/post-migration.py index 632035d374ec..dbc7dc322b87 100644 --- a/openupgrade_scripts/scripts/hr/16.0.1.1/post-migration.py +++ b/openupgrade_scripts/scripts/hr/16.0.1.1/post-migration.py @@ -44,13 +44,16 @@ def create_work_contact(env): partner.id, ) else: - matching_partner = env["res.partner"].search( - [ - ("email", "=", employee.work_email), - ("mobile", "=", employee.mobile_phone), - ] - ) - nb_matching_partner = len(matching_partner) + if employee.work_email and employee.mobile_phone: + matching_partner = env["res.partner"].search( + [ + ("email", "=", employee.work_email), + ("mobile", "=", employee.mobile_phone), + ] + ) + nb_matching_partner = len(matching_partner) + else: + nb_matching_partner = 0 if nb_matching_partner == 1: employee.work_contact_id = matching_partner _logger.info( From 17a8f6e3b6b71e8cba014ee809bcea328d6d6df0 Mon Sep 17 00:00:00 2001 From: "Pedro M. Baeza" Date: Wed, 7 May 2025 12:49:37 +0200 Subject: [PATCH 16/51] [OU-ADD] l10n_de: Nothing to do TT54919 --- docsource/modules150-160.rst | 2 +- .../l10n_de/16.0.1.0/upgrade_analysis.txt | 196 ------------------ .../16.0.2.0/upgrade_analysis_work.txt | 63 ++++++ 3 files changed, 64 insertions(+), 197 deletions(-) delete mode 100644 openupgrade_scripts/scripts/l10n_de/16.0.1.0/upgrade_analysis.txt create mode 100644 openupgrade_scripts/scripts/l10n_de/16.0.2.0/upgrade_analysis_work.txt diff --git a/docsource/modules150-160.rst b/docsource/modules150-160.rst index eb47edb271ac..5692d8100044 100644 --- a/docsource/modules150-160.rst +++ b/docsource/modules150-160.rst @@ -274,7 +274,7 @@ Module coverage 15.0 -> 16.0 +-------------------------------------------------+----------------------+-------------------------------------------------+ | l10n_cz | | | +-------------------------------------------------+----------------------+-------------------------------------------------+ -| l10n_de | | | +| l10n_de | Nothing to do | | +-------------------------------------------------+----------------------+-------------------------------------------------+ | |del| l10n_de_purchase | |No DB layout changes. | +-------------------------------------------------+----------------------+-------------------------------------------------+ diff --git a/openupgrade_scripts/scripts/l10n_de/16.0.1.0/upgrade_analysis.txt b/openupgrade_scripts/scripts/l10n_de/16.0.1.0/upgrade_analysis.txt deleted file mode 100644 index 1515731f1c39..000000000000 --- a/openupgrade_scripts/scripts/l10n_de/16.0.1.0/upgrade_analysis.txt +++ /dev/null @@ -1,196 +0,0 @@ ----Models in module 'l10n_de'--- ----Fields in module 'l10n_de'--- ----XML records in module 'l10n_de'--- -NEW account.report: l10n_de.tax_report -NEW account.report.column: l10n_de.tax_report_balance -NEW account.report.expression: l10n_de.tax_report_de_tag_21_tag -NEW account.report.expression: l10n_de.tax_report_de_tag_24_tag -NEW account.report.expression: l10n_de.tax_report_de_tag_26_tag -NEW account.report.expression: l10n_de.tax_report_de_tag_27_tag -NEW account.report.expression: l10n_de.tax_report_de_tag_33_tag -NEW account.report.expression: l10n_de.tax_report_de_tag_34_tag -NEW account.report.expression: l10n_de.tax_report_de_tag_35_tag -NEW account.report.expression: l10n_de.tax_report_de_tag_36_tag -NEW account.report.expression: l10n_de.tax_report_de_tag_39_tag -NEW account.report.expression: l10n_de.tax_report_de_tag_41_tag -NEW account.report.expression: l10n_de.tax_report_de_tag_42_tag -NEW account.report.expression: l10n_de.tax_report_de_tag_43_tag -NEW account.report.expression: l10n_de.tax_report_de_tag_44_tag -NEW account.report.expression: l10n_de.tax_report_de_tag_45_tag -NEW account.report.expression: l10n_de.tax_report_de_tag_47_tag -NEW account.report.expression: l10n_de.tax_report_de_tag_48_tag -NEW account.report.expression: l10n_de.tax_report_de_tag_49_tag -NEW account.report.expression: l10n_de.tax_report_de_tag_52_tag -NEW account.report.expression: l10n_de.tax_report_de_tag_53_tag -NEW account.report.expression: l10n_de.tax_report_de_tag_59_tag -NEW account.report.expression: l10n_de.tax_report_de_tag_60_tag -NEW account.report.expression: l10n_de.tax_report_de_tag_61_tag -NEW account.report.expression: l10n_de.tax_report_de_tag_62_tag -NEW account.report.expression: l10n_de.tax_report_de_tag_63_tag -NEW account.report.expression: l10n_de.tax_report_de_tag_64_tag -NEW account.report.expression: l10n_de.tax_report_de_tag_65_tag -NEW account.report.expression: l10n_de.tax_report_de_tag_66_tag -NEW account.report.expression: l10n_de.tax_report_de_tag_67_tag -NEW account.report.expression: l10n_de.tax_report_de_tag_68_tag -NEW account.report.expression: l10n_de.tax_report_de_tag_69_tag -NEW account.report.expression: l10n_de.tax_report_de_tag_73_tag -NEW account.report.expression: l10n_de.tax_report_de_tag_74_tag -NEW account.report.expression: l10n_de.tax_report_de_tag_76_tag -NEW account.report.expression: l10n_de.tax_report_de_tag_77_tag -NEW account.report.expression: l10n_de.tax_report_de_tag_78_tag -NEW account.report.expression: l10n_de.tax_report_de_tag_79_tag -NEW account.report.expression: l10n_de.tax_report_de_tag_80_tag -NEW account.report.expression: l10n_de.tax_report_de_tag_81_tag -NEW account.report.expression: l10n_de.tax_report_de_tag_83_tag -NEW account.report.expression: l10n_de.tax_report_de_tag_84_tag -NEW account.report.expression: l10n_de.tax_report_de_tag_85_tag -NEW account.report.expression: l10n_de.tax_report_de_tag_86_tag -NEW account.report.expression: l10n_de.tax_report_de_tag_89_tag -NEW account.report.expression: l10n_de.tax_report_de_tag_91_tag -NEW account.report.expression: l10n_de.tax_report_de_tag_93_tag -NEW account.report.expression: l10n_de.tax_report_de_tag_94_tag -NEW account.report.expression: l10n_de.tax_report_de_tag_95_tag -NEW account.report.expression: l10n_de.tax_report_de_tag_96_tag -NEW account.report.expression: l10n_de.tax_report_de_tag_98_tag -NEW account.report.expression: l10n_de.tax_report_de_tax_tag_45_tag -NEW account.report.line: l10n_de.tax_report_de_tag_01 -NEW account.report.line: l10n_de.tax_report_de_tag_02 -NEW account.report.line: l10n_de.tax_report_de_tag_17 -NEW account.report.line: l10n_de.tax_report_de_tag_18 -NEW account.report.line: l10n_de.tax_report_de_tag_19 -NEW account.report.line: l10n_de.tax_report_de_tag_21 -NEW account.report.line: l10n_de.tax_report_de_tag_24 -NEW account.report.line: l10n_de.tax_report_de_tag_25 -NEW account.report.line: l10n_de.tax_report_de_tag_26 -NEW account.report.line: l10n_de.tax_report_de_tag_27 -NEW account.report.line: l10n_de.tax_report_de_tag_31 -NEW account.report.line: l10n_de.tax_report_de_tag_33 -NEW account.report.line: l10n_de.tax_report_de_tag_34 -NEW account.report.line: l10n_de.tax_report_de_tag_35 -NEW account.report.line: l10n_de.tax_report_de_tag_36 -NEW account.report.line: l10n_de.tax_report_de_tag_37 -NEW account.report.line: l10n_de.tax_report_de_tag_39 -NEW account.report.line: l10n_de.tax_report_de_tag_41 -NEW account.report.line: l10n_de.tax_report_de_tag_42 -NEW account.report.line: l10n_de.tax_report_de_tag_43 -NEW account.report.line: l10n_de.tax_report_de_tag_44 -NEW account.report.line: l10n_de.tax_report_de_tag_45 -NEW account.report.line: l10n_de.tax_report_de_tag_46 -NEW account.report.line: l10n_de.tax_report_de_tag_47 -NEW account.report.line: l10n_de.tax_report_de_tag_48 -NEW account.report.line: l10n_de.tax_report_de_tag_49 -NEW account.report.line: l10n_de.tax_report_de_tag_52 -NEW account.report.line: l10n_de.tax_report_de_tag_53 -NEW account.report.line: l10n_de.tax_report_de_tag_59 -NEW account.report.line: l10n_de.tax_report_de_tag_60 -NEW account.report.line: l10n_de.tax_report_de_tag_61 -NEW account.report.line: l10n_de.tax_report_de_tag_62 -NEW account.report.line: l10n_de.tax_report_de_tag_63 -NEW account.report.line: l10n_de.tax_report_de_tag_64 -NEW account.report.line: l10n_de.tax_report_de_tag_65 -NEW account.report.line: l10n_de.tax_report_de_tag_66 -NEW account.report.line: l10n_de.tax_report_de_tag_67 -NEW account.report.line: l10n_de.tax_report_de_tag_68 -NEW account.report.line: l10n_de.tax_report_de_tag_69 -NEW account.report.line: l10n_de.tax_report_de_tag_73 -NEW account.report.line: l10n_de.tax_report_de_tag_74 -NEW account.report.line: l10n_de.tax_report_de_tag_76 -NEW account.report.line: l10n_de.tax_report_de_tag_77 -NEW account.report.line: l10n_de.tax_report_de_tag_78 -NEW account.report.line: l10n_de.tax_report_de_tag_79 -NEW account.report.line: l10n_de.tax_report_de_tag_80 -NEW account.report.line: l10n_de.tax_report_de_tag_81 -NEW account.report.line: l10n_de.tax_report_de_tag_83 -NEW account.report.line: l10n_de.tax_report_de_tag_84 -NEW account.report.line: l10n_de.tax_report_de_tag_85 -NEW account.report.line: l10n_de.tax_report_de_tag_86 -NEW account.report.line: l10n_de.tax_report_de_tag_89 -NEW account.report.line: l10n_de.tax_report_de_tag_91 -NEW account.report.line: l10n_de.tax_report_de_tag_93 -NEW account.report.line: l10n_de.tax_report_de_tag_94 -NEW account.report.line: l10n_de.tax_report_de_tag_95 -NEW account.report.line: l10n_de.tax_report_de_tag_96 -NEW account.report.line: l10n_de.tax_report_de_tag_98 -NEW account.report.line: l10n_de.tax_report_de_tax_tag_17 -NEW account.report.line: l10n_de.tax_report_de_tax_tag_18 -NEW account.report.line: l10n_de.tax_report_de_tax_tag_31 -NEW account.report.line: l10n_de.tax_report_de_tax_tag_37 -NEW account.report.line: l10n_de.tax_report_de_tax_tag_45 -NEW account.report.line: l10n_de.tax_report_de_tax_tag_46 -NEW account.report.line: l10n_de.tax_report_de_tax_tag_55 -NEW account.report.line: l10n_de.tax_report_de_tax_tag_64 -NEW account.report.line: l10n_de.tax_report_de_tax_tag_66 -DEL account.tax.report: l10n_de.tax_report -DEL account.tax.report.line: l10n_de.tax_report_de_tag_01 -DEL account.tax.report.line: l10n_de.tax_report_de_tag_02 -DEL account.tax.report.line: l10n_de.tax_report_de_tag_17 -DEL account.tax.report.line: l10n_de.tax_report_de_tag_18 -DEL account.tax.report.line: l10n_de.tax_report_de_tag_19 -DEL account.tax.report.line: l10n_de.tax_report_de_tag_21 -DEL account.tax.report.line: l10n_de.tax_report_de_tag_24 -DEL account.tax.report.line: l10n_de.tax_report_de_tag_25 -DEL account.tax.report.line: l10n_de.tax_report_de_tag_26 -DEL account.tax.report.line: l10n_de.tax_report_de_tag_27 -DEL account.tax.report.line: l10n_de.tax_report_de_tag_31 -DEL account.tax.report.line: l10n_de.tax_report_de_tag_33 -DEL account.tax.report.line: l10n_de.tax_report_de_tag_34 -DEL account.tax.report.line: l10n_de.tax_report_de_tag_35 -DEL account.tax.report.line: l10n_de.tax_report_de_tag_36 -DEL account.tax.report.line: l10n_de.tax_report_de_tag_37 -DEL account.tax.report.line: l10n_de.tax_report_de_tag_39 -DEL account.tax.report.line: l10n_de.tax_report_de_tag_41 -DEL account.tax.report.line: l10n_de.tax_report_de_tag_42 -DEL account.tax.report.line: l10n_de.tax_report_de_tag_43 -DEL account.tax.report.line: l10n_de.tax_report_de_tag_44 -DEL account.tax.report.line: l10n_de.tax_report_de_tag_45 -DEL account.tax.report.line: l10n_de.tax_report_de_tag_46 -DEL account.tax.report.line: l10n_de.tax_report_de_tag_47 -DEL account.tax.report.line: l10n_de.tax_report_de_tag_48 -DEL account.tax.report.line: l10n_de.tax_report_de_tag_49 -DEL account.tax.report.line: l10n_de.tax_report_de_tag_52 -DEL account.tax.report.line: l10n_de.tax_report_de_tag_53 -DEL account.tax.report.line: l10n_de.tax_report_de_tag_59 -DEL account.tax.report.line: l10n_de.tax_report_de_tag_60 -DEL account.tax.report.line: l10n_de.tax_report_de_tag_61 -DEL account.tax.report.line: l10n_de.tax_report_de_tag_62 -DEL account.tax.report.line: l10n_de.tax_report_de_tag_63 -DEL account.tax.report.line: l10n_de.tax_report_de_tag_64 -DEL account.tax.report.line: l10n_de.tax_report_de_tag_65 -DEL account.tax.report.line: l10n_de.tax_report_de_tag_66 -DEL account.tax.report.line: l10n_de.tax_report_de_tag_67 -DEL account.tax.report.line: l10n_de.tax_report_de_tag_68 -DEL account.tax.report.line: l10n_de.tax_report_de_tag_69 -DEL account.tax.report.line: l10n_de.tax_report_de_tag_73 -DEL account.tax.report.line: l10n_de.tax_report_de_tag_74 -DEL account.tax.report.line: l10n_de.tax_report_de_tag_76 -DEL account.tax.report.line: l10n_de.tax_report_de_tag_77 -DEL account.tax.report.line: l10n_de.tax_report_de_tag_78 -DEL account.tax.report.line: l10n_de.tax_report_de_tag_79 -DEL account.tax.report.line: l10n_de.tax_report_de_tag_80 -DEL account.tax.report.line: l10n_de.tax_report_de_tag_81 -DEL account.tax.report.line: l10n_de.tax_report_de_tag_83 -DEL account.tax.report.line: l10n_de.tax_report_de_tag_84 -DEL account.tax.report.line: l10n_de.tax_report_de_tag_85 -DEL account.tax.report.line: l10n_de.tax_report_de_tag_86 -DEL account.tax.report.line: l10n_de.tax_report_de_tag_89 -DEL account.tax.report.line: l10n_de.tax_report_de_tag_91 -DEL account.tax.report.line: l10n_de.tax_report_de_tag_93 -DEL account.tax.report.line: l10n_de.tax_report_de_tag_94 -DEL account.tax.report.line: l10n_de.tax_report_de_tag_95 -DEL account.tax.report.line: l10n_de.tax_report_de_tag_96 -DEL account.tax.report.line: l10n_de.tax_report_de_tag_98 -DEL account.tax.report.line: l10n_de.tax_report_de_tax_tag_17 -DEL account.tax.report.line: l10n_de.tax_report_de_tax_tag_18 -DEL account.tax.report.line: l10n_de.tax_report_de_tax_tag_31 -DEL account.tax.report.line: l10n_de.tax_report_de_tax_tag_37 -DEL account.tax.report.line: l10n_de.tax_report_de_tax_tag_45 -DEL account.tax.report.line: l10n_de.tax_report_de_tax_tag_46 -DEL account.tax.report.line: l10n_de.tax_report_de_tax_tag_55 -DEL account.tax.report.line: l10n_de.tax_report_de_tax_tag_64 -DEL account.tax.report.line: l10n_de.tax_report_de_tax_tag_66 -DEL ir.ui.menu: l10n_de.account_reports_de_statements_menu -DEL ir.ui.view: l10n_de.din5008_css -DEL ir.ui.view: l10n_de.external_layout_din5008 -DEL report.layout: l10n_de.report_layout_din5008 [renamed to l10n_din5008 module] -DEL report.paperformat: l10n_de.paperformat_euro_din [renamed to l10n_din5008 module] -DEL report.paperformat: l10n_de.paperformat_euro_din_a [renamed to l10n_din5008 module] diff --git a/openupgrade_scripts/scripts/l10n_de/16.0.2.0/upgrade_analysis_work.txt b/openupgrade_scripts/scripts/l10n_de/16.0.2.0/upgrade_analysis_work.txt new file mode 100644 index 000000000000..e291df62de99 --- /dev/null +++ b/openupgrade_scripts/scripts/l10n_de/16.0.2.0/upgrade_analysis_work.txt @@ -0,0 +1,63 @@ +---Models in module 'l10n_de'--- +---Fields in module 'l10n_de'--- +---XML records in module 'l10n_de'--- +NEW account.report.column: l10n_de.tax_report_balance +NEW account.report.expression: l10n_de.tax_report_de_tag_21_tag +NEW account.report.expression: l10n_de.tax_report_de_tag_24_tag +NEW account.report.expression: l10n_de.tax_report_de_tag_26_tag +NEW account.report.expression: l10n_de.tax_report_de_tag_27_tag +NEW account.report.expression: l10n_de.tax_report_de_tag_33_tag +NEW account.report.expression: l10n_de.tax_report_de_tag_34_tag +NEW account.report.expression: l10n_de.tax_report_de_tag_35_tag +NEW account.report.expression: l10n_de.tax_report_de_tag_36_tag +NEW account.report.expression: l10n_de.tax_report_de_tag_37_74_tag +NEW account.report.expression: l10n_de.tax_report_de_tag_39_tag +NEW account.report.expression: l10n_de.tax_report_de_tag_41_tag +NEW account.report.expression: l10n_de.tax_report_de_tag_42_tag +NEW account.report.expression: l10n_de.tax_report_de_tag_43_tag +NEW account.report.expression: l10n_de.tax_report_de_tag_44_tag +NEW account.report.expression: l10n_de.tax_report_de_tag_45_tag +NEW account.report.expression: l10n_de.tax_report_de_tag_47_tag +NEW account.report.expression: l10n_de.tax_report_de_tag_48_tag +NEW account.report.expression: l10n_de.tax_report_de_tag_49_tag +NEW account.report.expression: l10n_de.tax_report_de_tag_50_tag +NEW account.report.expression: l10n_de.tax_report_de_tag_59_tag +NEW account.report.expression: l10n_de.tax_report_de_tag_60_tag +NEW account.report.expression: l10n_de.tax_report_de_tag_61_tag +NEW account.report.expression: l10n_de.tax_report_de_tag_62_tag +NEW account.report.expression: l10n_de.tax_report_de_tag_63_tag +NEW account.report.expression: l10n_de.tax_report_de_tag_64_tag +NEW account.report.expression: l10n_de.tax_report_de_tag_65_tag +NEW account.report.expression: l10n_de.tax_report_de_tag_66_tag +NEW account.report.expression: l10n_de.tax_report_de_tag_67_tag +NEW account.report.expression: l10n_de.tax_report_de_tag_69_tag +NEW account.report.expression: l10n_de.tax_report_de_tag_73_tag +NEW account.report.expression: l10n_de.tax_report_de_tag_74_tag +NEW account.report.expression: l10n_de.tax_report_de_tag_76_tag +NEW account.report.expression: l10n_de.tax_report_de_tag_77_tag +NEW account.report.expression: l10n_de.tax_report_de_tag_80_tag +NEW account.report.expression: l10n_de.tax_report_de_tag_81_tag +NEW account.report.expression: l10n_de.tax_report_de_tag_83_tag +NEW account.report.expression: l10n_de.tax_report_de_tag_84_tag +NEW account.report.expression: l10n_de.tax_report_de_tag_85_tag +NEW account.report.expression: l10n_de.tax_report_de_tag_86_tag +NEW account.report.expression: l10n_de.tax_report_de_tag_87_tag +NEW account.report.expression: l10n_de.tax_report_de_tag_89_tag +NEW account.report.expression: l10n_de.tax_report_de_tag_90_tag +NEW account.report.expression: l10n_de.tax_report_de_tag_91_tag +NEW account.report.expression: l10n_de.tax_report_de_tag_93_tag +NEW account.report.expression: l10n_de.tax_report_de_tag_94_tag +NEW account.report.expression: l10n_de.tax_report_de_tag_95_tag +NEW account.report.expression: l10n_de.tax_report_de_tag_96_tag +NEW account.report.expression: l10n_de.tax_report_de_tag_98_tag +# NOTHING TO DO: New data for the account tax report engine + +DEL ir.ui.menu: l10n_de.account_reports_de_statements_menu +DEL ir.ui.view: l10n_de.din5008_css +DEL ir.ui.view: l10n_de.external_layout_din5008 +# NOTHING TO DO: ir noupdate=0 stuff + +DEL report.layout: l10n_de.report_layout_din5008 [renamed to l10n_din5008 module] +DEL report.paperformat: l10n_de.paperformat_euro_din [renamed to l10n_din5008 module] +DEL report.paperformat: l10n_de.paperformat_euro_din_a [renamed to l10n_din5008 module] +# NOTHING TO DO: To be renamed in pre in l10n_din5008 From ffd8909851207dd68d34acaa8fc8d5b5d03f0da7 Mon Sep 17 00:00:00 2001 From: "Pedro M. Baeza" Date: Wed, 7 May 2025 15:26:38 +0200 Subject: [PATCH 17/51] [OU-ADD] l10n_de_skr04: Nothing to do Even no analysis file. TT54923 --- docsource/modules150-160.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docsource/modules150-160.rst b/docsource/modules150-160.rst index 5692d8100044..120fcf1d635b 100644 --- a/docsource/modules150-160.rst +++ b/docsource/modules150-160.rst @@ -284,7 +284,7 @@ Module coverage 15.0 -> 16.0 +-------------------------------------------------+----------------------+-------------------------------------------------+ | l10n_de_skr03 | | | +-------------------------------------------------+----------------------+-------------------------------------------------+ -| l10n_de_skr04 | | | +| l10n_de_skr04 | Nothing to do | | +-------------------------------------------------+----------------------+-------------------------------------------------+ | |del| l10n_de_stock | |No DB layout changes. | +-------------------------------------------------+----------------------+-------------------------------------------------+ From 1a6c23432ddd870467d0f7c35e576850c80b002b Mon Sep 17 00:00:00 2001 From: Carlos Lopez Date: Tue, 6 May 2025 09:40:59 -0500 Subject: [PATCH 18/51] [OU-ADD] website_slides_survey: Migration to 16.0 --- docsource/modules150-160.rst | 2 +- .../16.0.1.0/post-migration.py | 16 ++++++++++ .../16.0.1.0/pre-migration.py | 19 +++++++++++ .../16.0.1.0/upgrade_analysis_work.txt | 32 +++++++++++++++++++ 4 files changed, 68 insertions(+), 1 deletion(-) create mode 100644 openupgrade_scripts/scripts/website_slides_survey/16.0.1.0/post-migration.py create mode 100644 openupgrade_scripts/scripts/website_slides_survey/16.0.1.0/pre-migration.py create mode 100644 openupgrade_scripts/scripts/website_slides_survey/16.0.1.0/upgrade_analysis_work.txt diff --git a/docsource/modules150-160.rst b/docsource/modules150-160.rst index 23f0d27ff087..1db099c5c82a 100644 --- a/docsource/modules150-160.rst +++ b/docsource/modules150-160.rst @@ -1004,7 +1004,7 @@ Module coverage 15.0 -> 16.0 +-------------------------------------------------+----------------------+-------------------------------------------------+ | website_slides_forum | | | +-------------------------------------------------+----------------------+-------------------------------------------------+ -| website_slides_survey | | | +| website_slides_survey | Done | | +-------------------------------------------------+----------------------+-------------------------------------------------+ | website_sms | | | +-------------------------------------------------+----------------------+-------------------------------------------------+ diff --git a/openupgrade_scripts/scripts/website_slides_survey/16.0.1.0/post-migration.py b/openupgrade_scripts/scripts/website_slides_survey/16.0.1.0/post-migration.py new file mode 100644 index 000000000000..fe8ebd98db8b --- /dev/null +++ b/openupgrade_scripts/scripts/website_slides_survey/16.0.1.0/post-migration.py @@ -0,0 +1,16 @@ +# Copyright 2025 Tecnativa - Carlos Lopez +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). + +from openupgradelib import openupgrade + + +@openupgrade.migrate() +def migrate(env, version): + openupgrade.load_data( + env.cr, "website_slides_survey", "16.0.1.0/noupdate_changes.xml" + ) + openupgrade.delete_record_translations( + env.cr, + "website_slides_survey", + ["mail_template_user_input_certification_failed"], + ) diff --git a/openupgrade_scripts/scripts/website_slides_survey/16.0.1.0/pre-migration.py b/openupgrade_scripts/scripts/website_slides_survey/16.0.1.0/pre-migration.py new file mode 100644 index 000000000000..fcf7f429ab9d --- /dev/null +++ b/openupgrade_scripts/scripts/website_slides_survey/16.0.1.0/pre-migration.py @@ -0,0 +1,19 @@ +# Copyright 2025 Tecnativa - Carlos Lopez +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). + +from openupgradelib import openupgrade + + +def _delete_sql_constraints(env): + """Delete constraints to recreate it""" + openupgrade.delete_sql_constraint_safely( + env, "website_slides_survey", "slide_slide", "check_survey_id" + ) + openupgrade.delete_sql_constraint_safely( + env, "website_slides_survey", "slide_slide", "check_certification_preview" + ) + + +@openupgrade.migrate() +def migrate(env, version): + _delete_sql_constraints(env) diff --git a/openupgrade_scripts/scripts/website_slides_survey/16.0.1.0/upgrade_analysis_work.txt b/openupgrade_scripts/scripts/website_slides_survey/16.0.1.0/upgrade_analysis_work.txt new file mode 100644 index 000000000000..0dcd01cc6460 --- /dev/null +++ b/openupgrade_scripts/scripts/website_slides_survey/16.0.1.0/upgrade_analysis_work.txt @@ -0,0 +1,32 @@ +---Models in module 'website_slides_survey'--- +---Fields in module 'website_slides_survey'--- +website_slides_survey / slide.slide / name (False) : NEW mode: modify, hasdefault: compute +# NOTHING TO DO: The field exists in the website_slides module as storable; just changed it to computed. + +website_slides_survey / slide.slide / slide_category (False) : NEW selection_keys: ['article', 'certification', 'document', 'infographic', 'quiz', 'video'], mode: modify +# NOTHING TO DO: The field exists in the website_slides module, the migration script is done on website_slides + +website_slides_survey / slide.slide / slide_type (False) : selection_keys is now '['article', 'certification', 'doc', 'google_drive_video', 'image', 'pdf', 'quiz', 'sheet', 'slides', 'vimeo_video', 'youtube_video']' ('['certification', 'document', 'infographic', 'presentation', 'quiz', 'video', 'webpage']') +# NOTHING TO DO: This is handled in the end-migration step of the website_slides module + +---XML records in module 'website_slides_survey'--- +DEL ir.actions.act_window: website_slides_survey.survey_survey_action_slides_report +DEL ir.ui.menu: website_slides_survey.website_slides_menu_report_certification +# NOTHING TO DO: Handled by ORM + +ir.model.constraint: website_slides_survey.constraint_slide_slide_check_certification_preview (changed definition: is now 'check(slide_category != 'certification' or is_preview = false)' ('check(slide_type != 'certification' or is_preview = false)')) +ir.model.constraint: website_slides_survey.constraint_slide_slide_check_survey_id (changed definition: is now 'check(slide_category != 'certification' or survey_id is not null)' ('check(slide_type != 'certification' or survey_id is not null)')) +# DONE: pre-migration: safely delete constraints for letting ORM to recreate them + +NEW ir.actions.act_window.view: website_slides_survey.survey_survey_action_slides_view_form +NEW ir.actions.act_window.view: website_slides_survey.survey_survey_action_slides_view_kanban +NEW ir.actions.act_window.view: website_slides_survey.survey_survey_action_slides_view_tree +NEW ir.ui.view: website_slides_survey.res_config_settings_view_form +NEW ir.ui.view: website_slides_survey.slide_sidebar_done_button +NEW ir.ui.view: website_slides_survey.slide_slide_partner_view_form +NEW ir.ui.view: website_slides_survey.slide_slide_partner_view_search +NEW ir.ui.view: website_slides_survey.slide_slide_partner_view_tree +NEW ir.ui.view: website_slides_survey.survey_survey_view_kanban +NEW ir.ui.view: website_slides_survey.survey_survey_view_search_slides +NEW ir.ui.view: website_slides_survey.survey_survey_view_tree_slides +# NOTHING TO DO: it's noupdate=0 stuff From c3cc58eb90667ca9f2c81bcc7f68741d694a30c1 Mon Sep 17 00:00:00 2001 From: Carlos Lopez Date: Wed, 7 May 2025 10:20:01 -0500 Subject: [PATCH 19/51] [OU-IMP] website_slides: Finish migration scripts Recompute slide_type in the end-migration instead of just renaming the column. This prevents incorrect recomputation when only this module is present, and ensures the field is properly recomputed at the end, taking into account other modules such as website_slides_survey. --- .../website_slides/16.0.2.6/end-migration.py | 14 ++++++++++++++ .../website_slides/16.0.2.6/pre-migration.py | 1 - .../16.0.2.6/upgrade_analysis_work.txt | 2 +- 3 files changed, 15 insertions(+), 2 deletions(-) create mode 100644 openupgrade_scripts/scripts/website_slides/16.0.2.6/end-migration.py diff --git a/openupgrade_scripts/scripts/website_slides/16.0.2.6/end-migration.py b/openupgrade_scripts/scripts/website_slides/16.0.2.6/end-migration.py new file mode 100644 index 000000000000..856d197946e1 --- /dev/null +++ b/openupgrade_scripts/scripts/website_slides/16.0.2.6/end-migration.py @@ -0,0 +1,14 @@ +# Copyright 2025 Tecnativa - Carlos Lopez +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). +from openupgradelib import openupgrade + + +@openupgrade.logging() +def _recompute_slide_slide_type(env): + """Recompute the field by calling its compute method.""" + env["slide.slide"].search([])._compute_slide_type() + + +@openupgrade.migrate() +def migrate(env, version): + _recompute_slide_slide_type(env) diff --git a/openupgrade_scripts/scripts/website_slides/16.0.2.6/pre-migration.py b/openupgrade_scripts/scripts/website_slides/16.0.2.6/pre-migration.py index 2f04f270465f..ce2b63853ffc 100644 --- a/openupgrade_scripts/scripts/website_slides/16.0.2.6/pre-migration.py +++ b/openupgrade_scripts/scripts/website_slides/16.0.2.6/pre-migration.py @@ -26,7 +26,6 @@ def _create_and_fill_data_from_slide_type_to_slide_category(env): [("webpage", "article"), ("presentation", "document")], table="slide_slide", ) - openupgrade.rename_columns(env.cr, {"slide_slide": [("slide_type", None)]}) def _create_and_fill_data_for_source_type(env): diff --git a/openupgrade_scripts/scripts/website_slides/16.0.2.6/upgrade_analysis_work.txt b/openupgrade_scripts/scripts/website_slides/16.0.2.6/upgrade_analysis_work.txt index 3231a053a9ac..8494de7ba235 100644 --- a/openupgrade_scripts/scripts/website_slides/16.0.2.6/upgrade_analysis_work.txt +++ b/openupgrade_scripts/scripts/website_slides/16.0.2.6/upgrade_analysis_work.txt @@ -45,7 +45,7 @@ website_slides / slide.slide / slide_category (selection) : NEW # DONE: pre-migration: copy column slide_type + map values that changes website_slides / slide.slide / slide_type (selection) : selection_keys is now '['article', 'doc', 'google_drive_video', 'image', 'pdf', 'quiz', 'sheet', 'slides', 'vimeo_video', 'youtube_video']' ('['document', 'infographic', 'presentation', 'quiz', 'video', 'webpage']') -# NOTHING TO DO: Let ORM handle recomputes this field +# DONE (end-migration): Let ORM handle recomputes this field website_slides / slide.slide / source_type (selection) : NEW required, selection_keys: ['external', 'local_file'], hasdefault: default # DONE: post-migration: Switch to external for those with `google_drive_id`, that are the only where these applies: https://github.com/odoo/odoo/blob/42bcc3ef284ca355e2323641176573b53e7d2e28/addons/website_slides/controllers/main.py#L1197 From dac0d0b78876cb2c373b511e5b9bc8406263e21d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Mart=C3=ADnez?= Date: Wed, 14 May 2025 08:37:14 +0200 Subject: [PATCH 20/51] [OU-IMP] analytic: Define the appropriate value for the root_plan_id field TT56324 --- .../scripts/analytic/16.0.1.1/post-migration.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/openupgrade_scripts/scripts/analytic/16.0.1.1/post-migration.py b/openupgrade_scripts/scripts/analytic/16.0.1.1/post-migration.py index 91814c497bbf..b85db243845b 100644 --- a/openupgrade_scripts/scripts/analytic/16.0.1.1/post-migration.py +++ b/openupgrade_scripts/scripts/analytic/16.0.1.1/post-migration.py @@ -6,3 +6,7 @@ def migrate(env, version): openupgrade.delete_records_safely_by_xml_id( env, ["analytic.analytic_tag_comp_rule", "analytic.analytic_group_comp_rule"] ) + # Define the appropriate value for the root_plan_id field. Necessary for accounts + # that previously had an account.analytic.group defined. + accounts = env["account.analytic.account"].search([("root_plan_id", "=", False)]) + accounts._compute_root_plan() From b35e08f8b1e886a790bbc052884766f4a97ef568 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Mart=C3=ADnez?= Date: Fri, 16 May 2025 09:50:20 +0200 Subject: [PATCH 21/51] [OU-FIX] hr: Avoid creating work contacts without data (email + phone) TT56359 --- openupgrade_scripts/scripts/hr/16.0.1.1/post-migration.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openupgrade_scripts/scripts/hr/16.0.1.1/post-migration.py b/openupgrade_scripts/scripts/hr/16.0.1.1/post-migration.py index dbc7dc322b87..0e241b2bffd3 100644 --- a/openupgrade_scripts/scripts/hr/16.0.1.1/post-migration.py +++ b/openupgrade_scripts/scripts/hr/16.0.1.1/post-migration.py @@ -75,7 +75,7 @@ def create_work_contact(env): partner.id, employee.id, ) - else: + elif employee.work_email or employee.mobile_phone: partner_vals = { "name": employee.name, "email": employee.work_email, From 3e4efd3fbd6cd5d4cd5f4b0a68dfdfba5809e65c Mon Sep 17 00:00:00 2001 From: "Pedro M. Baeza" Date: Sat, 24 May 2025 09:44:07 +0200 Subject: [PATCH 22/51] [OU-ADD website_slides_forum: Nothing to do TT56330 --- docsource/modules150-160.rst | 2 +- .../16.0.1.0/upgrade_analysis_work.txt | 9 +++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) create mode 100644 openupgrade_scripts/scripts/website_slides_forum/16.0.1.0/upgrade_analysis_work.txt diff --git a/docsource/modules150-160.rst b/docsource/modules150-160.rst index e60e5efac57f..56a4275214f8 100644 --- a/docsource/modules150-160.rst +++ b/docsource/modules150-160.rst @@ -1002,7 +1002,7 @@ Module coverage 15.0 -> 16.0 +-------------------------------------------------+----------------------+-------------------------------------------------+ | website_slides | Done | | +-------------------------------------------------+----------------------+-------------------------------------------------+ -| website_slides_forum | | | +| website_slides_forum | Nothing to do | | +-------------------------------------------------+----------------------+-------------------------------------------------+ | website_slides_survey | Done | | +-------------------------------------------------+----------------------+-------------------------------------------------+ diff --git a/openupgrade_scripts/scripts/website_slides_forum/16.0.1.0/upgrade_analysis_work.txt b/openupgrade_scripts/scripts/website_slides_forum/16.0.1.0/upgrade_analysis_work.txt new file mode 100644 index 000000000000..f4b8b71b7431 --- /dev/null +++ b/openupgrade_scripts/scripts/website_slides_forum/16.0.1.0/upgrade_analysis_work.txt @@ -0,0 +1,9 @@ +---Models in module 'website_slides_forum'--- +---Fields in module 'website_slides_forum'--- +---XML records in module 'website_slides_forum'--- +DEL ir.actions.act_window: website_slides_forum.forum_post_action_report +DEL ir.ui.menu: website_slides_forum.website_slides_menu_report_forum +NEW ir.ui.view: website_slides_forum.forum_forum_view_tree_slides +NEW ir.ui.view: website_slides_forum.res_config_settings_view_form +NEW ir.ui.view: website_slides_forum.snippet_options +# NOTHING TO DO: ir noupdate=0 stuff From d2138d122f937f486cb92ee4a35bad7099ccffdc Mon Sep 17 00:00:00 2001 From: Carlos Lopez Date: Mon, 26 May 2025 10:01:09 -0500 Subject: [PATCH 23/51] [OU-ADD] microsoft_account : Nothing to do --- docsource/modules150-160.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docsource/modules150-160.rst b/docsource/modules150-160.rst index 56a4275214f8..7968d9f585f1 100644 --- a/docsource/modules150-160.rst +++ b/docsource/modules150-160.rst @@ -562,7 +562,7 @@ Module coverage 15.0 -> 16.0 +-------------------------------------------------+----------------------+-------------------------------------------------+ | membership | Nothing to do |No DB layout changes. | +-------------------------------------------------+----------------------+-------------------------------------------------+ -| microsoft_account | |No DB layout changes. | +| microsoft_account | Nothing to do |No DB layout changes. | +-------------------------------------------------+----------------------+-------------------------------------------------+ | microsoft_calendar | |No DB layout changes. | +-------------------------------------------------+----------------------+-------------------------------------------------+ From 0b9e6c8c27b008db6fbfb6a3fcad09277c0b3461 Mon Sep 17 00:00:00 2001 From: Carlos Lopez Date: Mon, 26 May 2025 10:05:39 -0500 Subject: [PATCH 24/51] [OU-ADD] microsoft_calendar : Nothing to do --- docsource/modules150-160.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docsource/modules150-160.rst b/docsource/modules150-160.rst index 56a4275214f8..4d010c7e08c5 100644 --- a/docsource/modules150-160.rst +++ b/docsource/modules150-160.rst @@ -564,7 +564,7 @@ Module coverage 15.0 -> 16.0 +-------------------------------------------------+----------------------+-------------------------------------------------+ | microsoft_account | |No DB layout changes. | +-------------------------------------------------+----------------------+-------------------------------------------------+ -| microsoft_calendar | |No DB layout changes. | +| microsoft_calendar | Nothing to do |No DB layout changes. | +-------------------------------------------------+----------------------+-------------------------------------------------+ | microsoft_outlook | Done | | +-------------------------------------------------+----------------------+-------------------------------------------------+ From aa9db9f38f58a84db5b0a2e01973905d38f16cc4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miquel=20Ra=C3=AFch?= Date: Thu, 29 May 2025 12:18:05 +0200 Subject: [PATCH 25/51] [FIX] apriori: delete extra space in a key entry --- openupgrade_scripts/apriori.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openupgrade_scripts/apriori.py b/openupgrade_scripts/apriori.py index 1a3b84e6ae34..40bd4a50a1df 100644 --- a/openupgrade_scripts/apriori.py +++ b/openupgrade_scripts/apriori.py @@ -144,7 +144,7 @@ "coupon.rule": "loyalty.rule", "mail.channel.partner": "mail.channel.member", "payment.acquirer": "payment.provider", - "payment.acquirer.onboarding.wizard ": "payment.provider.onboarding.wizard", + "payment.acquirer.onboarding.wizard": "payment.provider.onboarding.wizard", "sale.coupon.apply.code": "sale.loyalty.coupon.wizard", "sale.payment.acquirer.onboarding.wizard": "sale.payment.provider.onboarding.wizard", "stock.location.route": "stock.route", From c0dedab4b903ad68e86fd9a309a943d349ccff7b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rapha=C3=ABl=20Valyi?= Date: Sat, 10 May 2025 17:34:37 +0000 Subject: [PATCH 26/51] [16.0][OU-FIX] base_address_extended: regexp fix --- .../scripts/base_address_extended/16.0.1.1/pre-migration.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openupgrade_scripts/scripts/base_address_extended/16.0.1.1/pre-migration.py b/openupgrade_scripts/scripts/base_address_extended/16.0.1.1/pre-migration.py index ca3a0368cf24..7a43ee068f1c 100644 --- a/openupgrade_scripts/scripts/base_address_extended/16.0.1.1/pre-migration.py +++ b/openupgrade_scripts/scripts/base_address_extended/16.0.1.1/pre-migration.py @@ -49,7 +49,7 @@ def migrate(env, _version): FROM ( SELECT id, - regexp_match(street, '^(.*?)(?:\\s([0-9][0-9\\S]*))?(?: - (.+))?$') AS rgx + regexp_match(street, '^(.*?)(?:\\s([0-9][0-9^\\s]*))?(?: - (.+))?$') AS rgx FROM res_partner WHERE street IS NOT NULL ) AS sub From 8469c1b9ee409dd776e9179ce1cf10fd6cb5d3ce Mon Sep 17 00:00:00 2001 From: OCA-git-bot Date: Tue, 3 Jun 2025 11:45:11 +0000 Subject: [PATCH 27/51] [UPD] addons table in README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 67eb848e571b..e751dd25431c 100644 --- a/README.md +++ b/README.md @@ -26,7 +26,7 @@ Available addons ---------------- addon | version | maintainers | summary --- | --- | --- | --- -[openupgrade_framework](openupgrade_framework/) | 16.0.1.0.0 | [![legalsylvain](https://github.com/legalsylvain.png?size=30px)](https://github.com/legalsylvain) [![StefanRijnhart](https://github.com/StefanRijnhart.png?size=30px)](https://github.com/StefanRijnhart) [![hbrunn](https://github.com/hbrunn.png?size=30px)](https://github.com/hbrunn) | Module to integrate in the server_wide_modules option to make upgrades between two major revisions. +[openupgrade_framework](openupgrade_framework/) | 16.0.1.0.0 | legalsylvain StefanRijnhart hbrunn | Module to integrate in the server_wide_modules option to make upgrades between two major revisions. [openupgrade_scripts](openupgrade_scripts/) | 16.0.1.0.4 | | Module that contains all the migrations analysis and scripts for migrating Odoo SA modules. [//]: # (end addons) From dc0be131afb3e675884b7811b260d2a53b9fdd8a Mon Sep 17 00:00:00 2001 From: remi-filament <30716308+remi-filament@users.noreply.github.com> Date: Wed, 14 Feb 2024 13:58:57 +0100 Subject: [PATCH 28/51] [OU-ADD] repair: Migration scripts for v16 --- docsource/modules150-160.rst | 2 +- .../scripts/repair/16.0.1.0/post-migration.py | 12 +++++++++ .../repair/16.0.1.0/upgrade_analysis_work.txt | 26 +++++++++++++++++++ 3 files changed, 39 insertions(+), 1 deletion(-) create mode 100644 openupgrade_scripts/scripts/repair/16.0.1.0/post-migration.py create mode 100644 openupgrade_scripts/scripts/repair/16.0.1.0/upgrade_analysis_work.txt diff --git a/docsource/modules150-160.rst b/docsource/modules150-160.rst index e60e5efac57f..5826d6c527d9 100644 --- a/docsource/modules150-160.rst +++ b/docsource/modules150-160.rst @@ -746,7 +746,7 @@ Module coverage 15.0 -> 16.0 +-------------------------------------------------+----------------------+-------------------------------------------------+ | rating | Nothing to do | | +-------------------------------------------------+----------------------+-------------------------------------------------+ -| repair | | | +| repair | Done | | +-------------------------------------------------+----------------------+-------------------------------------------------+ | resource | Done | | +-------------------------------------------------+----------------------+-------------------------------------------------+ diff --git a/openupgrade_scripts/scripts/repair/16.0.1.0/post-migration.py b/openupgrade_scripts/scripts/repair/16.0.1.0/post-migration.py new file mode 100644 index 000000000000..86b90105c577 --- /dev/null +++ b/openupgrade_scripts/scripts/repair/16.0.1.0/post-migration.py @@ -0,0 +1,12 @@ +# Copyright 2024 Le Filament +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). + +from openupgradelib import openupgrade + + +@openupgrade.migrate() +def migrate(env, version): + openupgrade.load_data(env.cr, "repair", "16.0.1.0/noupdate_changes.xml") + openupgrade.delete_record_translations( + env.cr, "repair", ["mail_template_repair_quotation"], ["name", "description"] + ) diff --git a/openupgrade_scripts/scripts/repair/16.0.1.0/upgrade_analysis_work.txt b/openupgrade_scripts/scripts/repair/16.0.1.0/upgrade_analysis_work.txt new file mode 100644 index 000000000000..650f5d61d89e --- /dev/null +++ b/openupgrade_scripts/scripts/repair/16.0.1.0/upgrade_analysis_work.txt @@ -0,0 +1,26 @@ +---Models in module 'repair'--- +---Fields in module 'repair'--- +repair / repair.fee / price_total (float) : is now stored +repair / repair.line / price_total (float) : is now stored +# NOTIHING TO DO: handled by ORM + +repair / repair.line / lot_id (many2one) : relation is now 'stock.lot' ('stock.production.lot') [nothing to do] +repair / repair.order / lot_id (many2one) : relation is now 'stock.lot' ('stock.production.lot') [nothing to do] +# NOTHING TO DO: renaming done in stock + +repair / repair.order / location_id (many2one) : now a function +repair / repair.order / product_uom (many2one) : now a function +# NOTHING TO DO: field already existed (was a onchange) + +repair / repair.order / picking_id (many2one) : NEW relation: stock.picking +repair / stock.picking / repair_ids (one2many) : NEW relation: repair.order +# NOTHING TO DO: new relation + +repair / stock.picking.type / is_repairable (boolean) : NEW hasdefault: compute +repair / stock.picking.type / return_type_of_ids (one2many) : NEW relation: stock.picking.type +# NOTHING TO DO: new fields + +---XML records in module 'repair'--- +NEW ir.ui.view: repair.repair_view_picking_form +NEW ir.ui.view: repair.repair_view_picking_type_form +# NOTHING TO DO From e5653f9665f7123daa20730b063182ff0ed2254d Mon Sep 17 00:00:00 2001 From: OCA-git-bot Date: Tue, 15 Jul 2025 06:43:51 +0000 Subject: [PATCH 29/51] [BOT] post-merge updates --- README.md | 4 +-- openupgrade_framework/README.rst | 8 +++-- openupgrade_framework/__manifest__.py | 2 +- .../static/description/index.html | 34 +++++++++++-------- openupgrade_scripts/README.rst | 8 +++-- openupgrade_scripts/__manifest__.py | 2 +- .../static/description/index.html | 26 ++++++++------ 7 files changed, 52 insertions(+), 32 deletions(-) diff --git a/README.md b/README.md index e751dd25431c..09dcdca07c5a 100644 --- a/README.md +++ b/README.md @@ -26,8 +26,8 @@ Available addons ---------------- addon | version | maintainers | summary --- | --- | --- | --- -[openupgrade_framework](openupgrade_framework/) | 16.0.1.0.0 | legalsylvain StefanRijnhart hbrunn | Module to integrate in the server_wide_modules option to make upgrades between two major revisions. -[openupgrade_scripts](openupgrade_scripts/) | 16.0.1.0.4 | | Module that contains all the migrations analysis and scripts for migrating Odoo SA modules. +[openupgrade_framework](openupgrade_framework/) | 16.0.1.0.1 | legalsylvain StefanRijnhart hbrunn | Module to integrate in the server_wide_modules option to make upgrades between two major revisions. +[openupgrade_scripts](openupgrade_scripts/) | 16.0.1.0.5 | | Module that contains all the migrations analysis and scripts for migrating Odoo SA modules. [//]: # (end addons) diff --git a/openupgrade_framework/README.rst b/openupgrade_framework/README.rst index 0f7a338d304c..5b2787a2bc64 100644 --- a/openupgrade_framework/README.rst +++ b/openupgrade_framework/README.rst @@ -1,3 +1,7 @@ +.. image:: https://odoo-community.org/readme-banner-image + :target: https://odoo-community.org/get-involved?utm_source=readme + :alt: Odoo Community Association + ===================== Openupgrade Framework ===================== @@ -7,13 +11,13 @@ Openupgrade Framework !! This file is generated by oca-gen-addon-readme !! !! changes will be overwritten. !! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - !! source digest: sha256:5b5aa97d1e9d7df96e3076992e0c0b2a86d4712d4ecc2dc56bf863600ac0684f + !! source digest: sha256:945275c27187090272d2b06ad20e5f5e1447983d05ac4a7d08e38f9b4aa0468f !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! .. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png :target: https://odoo-community.org/page/development-status :alt: Beta -.. |badge2| image:: https://img.shields.io/badge/licence-AGPL--3-blue.png +.. |badge2| image:: https://img.shields.io/badge/license-AGPL--3-blue.png :target: http://www.gnu.org/licenses/agpl-3.0-standalone.html :alt: License: AGPL-3 .. |badge3| image:: https://img.shields.io/badge/github-OCA%2FOpenUpgrade-lightgray.png?logo=github diff --git a/openupgrade_framework/__manifest__.py b/openupgrade_framework/__manifest__.py index 550b052db116..9b160416253f 100644 --- a/openupgrade_framework/__manifest__.py +++ b/openupgrade_framework/__manifest__.py @@ -9,7 +9,7 @@ "maintainers": ["legalsylvain", "StefanRijnhart", "hbrunn"], "website": "https://github.com/OCA/OpenUpgrade", "category": "Migration", - "version": "16.0.1.0.0", + "version": "16.0.1.0.1", "license": "AGPL-3", "depends": ["base"], "images": ["static/description/banner.jpg"], diff --git a/openupgrade_framework/static/description/index.html b/openupgrade_framework/static/description/index.html index bbaf2d261e66..bff009a5d0cb 100644 --- a/openupgrade_framework/static/description/index.html +++ b/openupgrade_framework/static/description/index.html @@ -3,7 +3,7 @@ -Openupgrade Framework +README.rst -
-

Openupgrade Framework

+
+ + +Odoo Community Association + +
+

Openupgrade Framework

-

Beta License: AGPL-3 OCA/OpenUpgrade Translate me on Weblate Try me on Runboat

+

Beta License: AGPL-3 OCA/OpenUpgrade Translate me on Weblate Try me on Runboat

This module is a technical module that contains a number of monkeypatches to improve the behaviour of Odoo when migrating your database using the OpenUpgrade migration scripts:

@@ -417,12 +422,12 @@

Openupgrade Framework

-

Installation

+

Installation

This module does not need to be installed on a database. It simply needs to be available via your addons-path.

-

Configuration

+

Configuration

  • call your odoo instance with the option --load=base,web,openupgrade_framework
  • @@ -441,7 +446,7 @@

    Configuration

    of the OpenUpgrade migration scripts.

-

Development

+

Development

The odoo_patch folder contains python files in a tree that mimicks the folder tree of the Odoo project. It contains a number of monkey patches to improve the migration of an Odoo database between two major versions.

@@ -485,7 +490,7 @@

Development

-

Bug Tracker

+

Bug Tracker

Bugs are tracked on GitHub Issues. In case of trouble, please check there if your issue has already been reported. If you spotted it first, help us to smash it by providing a detailed and welcomed @@ -493,9 +498,9 @@

Bug Tracker

Do not contact contributors directly about support or help with technical issues.

-

Credits

+

Credits

-

Authors

+

Authors

  • Therp BV
  • Opener B.V.
  • @@ -504,21 +509,21 @@

    Authors

-

Other credits

+

Other credits

Many developers have contributed to the OpenUpgrade framework in its previous incarnation. Their original contributions may no longer needed, or they are no longer recognizable in their current form but OpenUpgrade would not have existed at this point without them.

-

Maintainers

+

Maintainers

This module is maintained by the OCA.

Odoo Community Association @@ -533,5 +538,6 @@

Maintainers

+
diff --git a/openupgrade_scripts/README.rst b/openupgrade_scripts/README.rst index a286bb88311b..d42874bc9689 100644 --- a/openupgrade_scripts/README.rst +++ b/openupgrade_scripts/README.rst @@ -1,3 +1,7 @@ +.. image:: https://odoo-community.org/readme-banner-image + :target: https://odoo-community.org/get-involved?utm_source=readme + :alt: Odoo Community Association + =================== Openupgrade Scripts =================== @@ -7,13 +11,13 @@ Openupgrade Scripts !! This file is generated by oca-gen-addon-readme !! !! changes will be overwritten. !! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - !! source digest: sha256:58792095dc539f1f4eccbc45de3679c28e3176d8bf3682b315d670e6f3877639 + !! source digest: sha256:3d4eb565304d229b449be4d0734a5f9693ed41801b58114c63461c04fea3c5b3 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! .. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png :target: https://odoo-community.org/page/development-status :alt: Beta -.. |badge2| image:: https://img.shields.io/badge/licence-AGPL--3-blue.png +.. |badge2| image:: https://img.shields.io/badge/license-AGPL--3-blue.png :target: http://www.gnu.org/licenses/agpl-3.0-standalone.html :alt: License: AGPL-3 .. |badge3| image:: https://img.shields.io/badge/github-OCA%2FOpenUpgrade-lightgray.png?logo=github diff --git a/openupgrade_scripts/__manifest__.py b/openupgrade_scripts/__manifest__.py index 7f0fe75557c8..822daad63a5d 100644 --- a/openupgrade_scripts/__manifest__.py +++ b/openupgrade_scripts/__manifest__.py @@ -7,7 +7,7 @@ "author": "Odoo Community Association (OCA)", "website": "https://github.com/OCA/OpenUpgrade", "category": "Migration", - "version": "16.0.1.0.4", + "version": "16.0.1.0.5", "license": "AGPL-3", "depends": ["base"], "images": ["static/description/banner.jpg"], diff --git a/openupgrade_scripts/static/description/index.html b/openupgrade_scripts/static/description/index.html index ecfbcfb92084..05c9dd91c5d9 100644 --- a/openupgrade_scripts/static/description/index.html +++ b/openupgrade_scripts/static/description/index.html @@ -3,7 +3,7 @@ -Openupgrade Scripts +README.rst -
-

Openupgrade Scripts

+
+ + +Odoo Community Association + +
+

Openupgrade Scripts

-

Beta License: AGPL-3 OCA/OpenUpgrade Translate me on Weblate Try me on Runboat

+

Beta License: AGPL-3 OCA/OpenUpgrade Translate me on Weblate Try me on Runboat

This module is a containers of migration script to migrate from 15.0 to 16.0 version.

Table of contents

@@ -385,12 +390,12 @@

Openupgrade Scripts

-

Installation

+

Installation

This module does not need to be installed on a database. It simply needs to be available via your addons-path.

-

Configuration

+

Configuration

  • call your odoo instance with the option --upgrade-path=/PATH_TO_openupgrade_scripts_MODULE/scripts/
  • @@ -405,7 +410,7 @@

    Configuration

-

Bug Tracker

+

Bug Tracker

Bugs are tracked on GitHub Issues. In case of trouble, please check there if your issue has already been reported. If you spotted it first, help us to smash it by providing a detailed and welcomed @@ -413,9 +418,9 @@

Bug Tracker

Do not contact contributors directly about support or help with technical issues.

-

Credits

+

Credits

-

Maintainers

+

Maintainers

This module is maintained by the OCA.

Odoo Community Association @@ -428,5 +433,6 @@

Maintainers

+
From 4347c4e98f12880b0a0dcc5cbbdc0b51b9b5fa60 Mon Sep 17 00:00:00 2001 From: Simone Rubino Date: Fri, 25 Jul 2025 14:13:13 +0200 Subject: [PATCH 30/51] [MIG] l10n_it_riba: Rename to l10n_it_riba_oca The existing module conflicts with a new module named exactly l10n_it_riba in Odoo Enterprise --- openupgrade_scripts/apriori.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openupgrade_scripts/apriori.py b/openupgrade_scripts/apriori.py index 40bd4a50a1df..70d63f6462d2 100644 --- a/openupgrade_scripts/apriori.py +++ b/openupgrade_scripts/apriori.py @@ -56,7 +56,7 @@ # OCA/l10n-italy "assets_management": "l10n_it_asset_management", "l10n_it_account_balance_eu": "l10n_it_financial_statement_eu", - "l10n_it_ricevute_bancarie": "l10n_it_riba", + "l10n_it_ricevute_bancarie": "l10n_it_riba_oca", # OCA/... } From 77481641ce9008253e7995f642006749b89b94fe Mon Sep 17 00:00:00 2001 From: "Pedro M. Baeza" Date: Fri, 25 Jul 2025 21:24:59 +0200 Subject: [PATCH 31/51] [OU-FIX] website: Exclude survey models from BS conversion They don't insert website blocks, and coming from non sanitized content, they can give an error. --- openupgrade_scripts/scripts/website/16.0.1.0/end-migration.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/openupgrade_scripts/scripts/website/16.0.1.0/end-migration.py b/openupgrade_scripts/scripts/website/16.0.1.0/end-migration.py index 4e97dbfd9ea5..47b74c7af8b0 100644 --- a/openupgrade_scripts/scripts/website/16.0.1.0/end-migration.py +++ b/openupgrade_scripts/scripts/website/16.0.1.0/end-migration.py @@ -45,6 +45,8 @@ def convert_field_html_string_bootstrap_4to5(env): "mailing.mailing", "account.invoice.send", "mail.alias", + "survey.survey", + "survey.question", ] # We could want to refine a certain field logic to discard a good bunch of records field_special_domain = { From 4591d6604b7e2a7465179f458d2e4ba4acfb5856 Mon Sep 17 00:00:00 2001 From: "Pedro M. Baeza" Date: Fri, 25 Jul 2025 22:06:22 +0200 Subject: [PATCH 32/51] [OU-FIX] website: Exclude forum from BS conversion It's also non sanitized and it doesn't contain website blocks. --- openupgrade_scripts/scripts/website/16.0.1.0/end-migration.py | 1 + 1 file changed, 1 insertion(+) diff --git a/openupgrade_scripts/scripts/website/16.0.1.0/end-migration.py b/openupgrade_scripts/scripts/website/16.0.1.0/end-migration.py index 47b74c7af8b0..abaf0c910468 100644 --- a/openupgrade_scripts/scripts/website/16.0.1.0/end-migration.py +++ b/openupgrade_scripts/scripts/website/16.0.1.0/end-migration.py @@ -47,6 +47,7 @@ def convert_field_html_string_bootstrap_4to5(env): "mail.alias", "survey.survey", "survey.question", + "forum.forum", ] # We could want to refine a certain field logic to discard a good bunch of records field_special_domain = { From f92284ae6f1bb28faa4eb9a1a04de3e6c8c7dd7f Mon Sep 17 00:00:00 2001 From: "Pedro M. Baeza" Date: Sat, 26 Jul 2025 08:17:35 +0200 Subject: [PATCH 33/51] [OU-FIX] website: Do BS conversion with sanitization override Certain fields had sanitize=False or other sanitization disablings (like sanitize_attributes=False or sanitize_form=False), so when converting to BS 5, we should allow to save the result without re-sanitizing such content. For that, if the user is not on the sanitize overridable group, we add it, removing it after conversion. --- .../scripts/website/16.0.1.0/end-migration.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/openupgrade_scripts/scripts/website/16.0.1.0/end-migration.py b/openupgrade_scripts/scripts/website/16.0.1.0/end-migration.py index abaf0c910468..43f106d8d67a 100644 --- a/openupgrade_scripts/scripts/website/16.0.1.0/end-migration.py +++ b/openupgrade_scripts/scripts/website/16.0.1.0/end-migration.py @@ -57,6 +57,16 @@ def convert_field_html_string_bootstrap_4to5(env): ] }, } + # Certain fields had sanitize=False or other sanitization disablings (like + # sanitize_attributes=False or sanitize_form=False), so when converting to BS 5, + # we should allow to save the result without re-sanitizing such content. For that, + # if the user is not on the sanitize overridable group, we add it, removing it after + # conversion + group_overridable = False + if not env.user._has_group("base.group_sanitize_override"): + group_overridable = env.ref("base.group_sanitize_override") + env.user.groups_id = [(4, group_overridable.id)] + # Search fields = env["ir.model.fields"].search( [ ("ttype", "=", "html"), @@ -75,6 +85,9 @@ def convert_field_html_string_bootstrap_4to5(env): env.cr, env[model]._table, field.name ): convert_field_bootstrap_4to5(env, model, field.name, domain=domain) + # Remove the group if applicable + if group_overridable: + env.user.groups_id = [(3, group_overridable.id)] def rename_t_group_website_restricted_editor(env): From d93ec5bb99590ee33f9d0d177f1b8816b619cf7c Mon Sep 17 00:00:00 2001 From: "Pedro M. Baeza" Date: Sat, 26 Jul 2025 08:23:16 +0200 Subject: [PATCH 34/51] [OU-FIX] website: Add website editors to sanitization override group Website editors that come from v15, where there was no sanitization, would expect the same on the new version, or worst: they introduced some content like iframe in 15, and re-editing that content in 16 leads to lose it when saving it. Thus, let's add all of them to the override sanitization group for keeping the same behavior. --- .../scripts/website/16.0.1.0/post-migration.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/openupgrade_scripts/scripts/website/16.0.1.0/post-migration.py b/openupgrade_scripts/scripts/website/16.0.1.0/post-migration.py index f0da611d290c..f6c5d7b3c39f 100644 --- a/openupgrade_scripts/scripts/website/16.0.1.0/post-migration.py +++ b/openupgrade_scripts/scripts/website/16.0.1.0/post-migration.py @@ -4,3 +4,9 @@ @openupgrade.migrate() def migrate(env, version): openupgrade.load_data(env.cr, "website", "16.0.1.0/noupdate_changes.xml") + # Website editors that come from v15, where there was no sanitization, would expect + # the same on the new version, or worst: they introduce some content like iframe, + # and re-editing that content in 16 leads to lose it when saving it. Thus, let's + # add all of them to the override sanitization group for keeping the same behavior. + users = env.ref("website.group_website_restricted_editor").users + users.groups_id = [(4, env.ref("base.group_sanitize_override").id)] From a7afdee696d59fdad78bb6dede65473e2c38aa33 Mon Sep 17 00:00:00 2001 From: "Pedro M. Baeza" Date: Tue, 12 Aug 2025 20:34:03 +0200 Subject: [PATCH 35/51] [OU-IMP] base: Pre-create res.partner~company_registry This column is not calculated in the base module (see https://github.com/odoo/odoo/blob/9728a1754424b9e5bfa93ec5d53a5179fa9d7d05/odoo/addons/base/models/res_partner.py#L440) and wasting any time, specially when you have a lot of partners, it's useless, so let's pre-create it. --- openupgrade_scripts/scripts/base/16.0.1.3/pre-migration.py | 2 ++ .../scripts/base/16.0.1.3/upgrade_analysis_work.txt | 4 +++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/openupgrade_scripts/scripts/base/16.0.1.3/pre-migration.py b/openupgrade_scripts/scripts/base/16.0.1.3/pre-migration.py index 50f218a60cb5..bebe446891a6 100644 --- a/openupgrade_scripts/scripts/base/16.0.1.3/pre-migration.py +++ b/openupgrade_scripts/scripts/base/16.0.1.3/pre-migration.py @@ -168,5 +168,7 @@ def migrate(cr, version): "USING ir_ui_view v " "WHERE r.view_id=v.id AND v.inherit_id IS NOT NULL AND v.mode != 'primary'" ) + # pre-create res.partner~company_registry + openupgrade.logged_query(cr, "ALTER TABLE res_partner ADD company_registry VARCHAR") # update all translatable fields update_translatable_fields(cr) diff --git a/openupgrade_scripts/scripts/base/16.0.1.3/upgrade_analysis_work.txt b/openupgrade_scripts/scripts/base/16.0.1.3/upgrade_analysis_work.txt index 20b1b9d6fb79..19f8a77bc847 100644 --- a/openupgrade_scripts/scripts/base/16.0.1.3/upgrade_analysis_work.txt +++ b/openupgrade_scripts/scripts/base/16.0.1.3/upgrade_analysis_work.txt @@ -28,7 +28,6 @@ base / res.company / active (boolean) : NEW ha base / res.company / company_registry (char) : not stored anymore base / res.company / company_registry (char) : now related base / res.company / font (selection) : selection_keys is now '['Lato', 'Montserrat', 'Open_Sans', 'Oswald', 'Raleway', 'Roboto', 'Tajawal']' ('['Lato', 'Montserrat', 'Open_Sans', 'Oswald', 'Raleway', 'Roboto']') -base / res.partner / company_registry (char) : NEW hasdefault: compute base / res.partner / credit_limit (float) : module is now 'account' ('base') base / res.partner / credit_limit (float) : not stored anymore base / res.partner.bank / allow_out_payment (boolean) : NEW hasdefault: default @@ -40,6 +39,9 @@ base / res.users.deletion / user_id_int (integer) : NEW is # NOTHING TO DO +base / res.partner / company_registry (char) : NEW hasdefault: compute +# DONE: pre-migration: Pre-create the field for not triggering the compute. Further modules scripts (right now only l10n_be and l10n_ro seems to override the method) have to include the computation, or trigger the computation on end-migration. + ---XML records in module 'base'--- DEL ir.actions.act_window: base.action_translation DEL ir.actions.act_window: base.action_wizard_update_translations From b9f3f1439ad42d9256ed7fcd6032cd8a78ac12f6 Mon Sep 17 00:00:00 2001 From: "Pedro M. Baeza" Date: Thu, 14 Aug 2025 20:29:04 +0200 Subject: [PATCH 36/51] [OU-FIX] purchase_requisition: Proper order group creation (and global) + no delete The PO groups weren't created properly before, so the new query is doing the correct job, and doing it for all the requisitions, not only those of one type. The previous code was also deleting all the requisitions of a deleted type, but doing that, apart from being partial, it's counter-productive, requiring a lot of work with no benefit, so let's keep them. --- .../16.0.0.1/post-migration.py | 70 ++++++------------- .../16.0.0.1/upgrade_analysis_work.txt | 2 +- 2 files changed, 22 insertions(+), 50 deletions(-) diff --git a/openupgrade_scripts/scripts/purchase_requisition/16.0.0.1/post-migration.py b/openupgrade_scripts/scripts/purchase_requisition/16.0.0.1/post-migration.py index 5d4a18798d8a..b31913bdd0b0 100644 --- a/openupgrade_scripts/scripts/purchase_requisition/16.0.0.1/post-migration.py +++ b/openupgrade_scripts/scripts/purchase_requisition/16.0.0.1/post-migration.py @@ -1,10 +1,9 @@ -# Copyright 2024 Tecnativa - Pedro M. Baeza +# Copyright 2024,2025 Tecnativa - Pedro M. Baeza # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). from openupgradelib import openupgrade def fill_purchase_order_group_from_tenders(env): - tender_type = env.ref("purchase_requisition.type_multi") openupgrade.logged_query( env.cr, """ @@ -12,60 +11,33 @@ def fill_purchase_order_group_from_tenders(env): ADD COLUMN IF NOT EXISTS old_purchase_requisition_id INTEGER """, ) + # Create a group if there is more than one PO per requisition openupgrade.logged_query( env.cr, - f""" - INSERT INTO purchase_order_group (old_purchase_requisition_id, - create_date, create_uid, write_date, write_uid) - SELECT DISTINCT ON (pr.id) pr.id, - pr.create_date, pr.create_uid, pr.write_date, pr.write_uid - FROM purchase_requisition pr - JOIN purchase_order po1 ON po1.requisition_id = pr.id - JOIN purchase_order po2 ON po2.requisition_id = pr.id AND po1.id != po2.id - -- only create group if there is more than one purchase - WHERE pr.type_id = {tender_type.id} - RETURNING old_purchase_requisition_id + """ + INSERT INTO purchase_order_group + (old_purchase_requisition_id, create_date, create_uid, write_date, write_uid) + SELECT + t.requisition_id, pr.create_date, pr.create_uid, pr.write_date, pr.write_uid + FROM ( + SELECT *, row_number() + over (partition BY requisition_id ORDER BY id) AS rnum + FROM purchase_order + ) t + JOIN purchase_requisition pr ON pr.id = t.requisition_id + WHERE t.rnum = 2; """, ) - tender_requisition_ids = [x[0] for x in env.cr.fetchall()] - if tender_requisition_ids: - openupgrade.logged_query( - env.cr, - """ - UPDATE purchase_order po - SET purchase_group_id = pog.id - FROM purchase_order_group pog - WHERE po.requisition_id = pog.old_purchase_requisition_id - """, - ) + # Assign it to the purchase orders openupgrade.logged_query( env.cr, - f""" - SELECT pr.id - FROM purchase_requisition pr - WHERE pr.type_id = {tender_type.id} - """, + """ + UPDATE purchase_order po + SET purchase_group_id = pog.id + FROM purchase_order_group pog + WHERE po.requisition_id = pog.old_purchase_requisition_id + """, ) - obsolete_requisition_ids = [x[0] for x in env.cr.fetchall()] - if obsolete_requisition_ids: - openupgrade.logged_query( - env.cr, - f""" - UPDATE purchase_order po - SET requisition_id = NULL - FROM purchase_requisition pr - WHERE po.requisition_id = pr.id AND pr.type_id = {tender_type.id} - """, - ) - openupgrade.logged_query( - env.cr, - """ - UPDATE purchase_requisition pr - SET state = 'draft' - WHERE pr.state not in ('draft', 'cancel') - """, - ) - env["purchase.requisition"].browse(obsolete_requisition_ids).unlink() @openupgrade.migrate() diff --git a/openupgrade_scripts/scripts/purchase_requisition/16.0.0.1/upgrade_analysis_work.txt b/openupgrade_scripts/scripts/purchase_requisition/16.0.0.1/upgrade_analysis_work.txt index 406cd60b7fcf..2e5c61b40d92 100644 --- a/openupgrade_scripts/scripts/purchase_requisition/16.0.0.1/upgrade_analysis_work.txt +++ b/openupgrade_scripts/scripts/purchase_requisition/16.0.0.1/upgrade_analysis_work.txt @@ -1,7 +1,7 @@ new model purchase.order.group purchase_requisition / purchase.order / purchase_group_id (many2one) : NEW relation: purchase.order.group purchase_requisition / purchase.order.group / order_ids (one2many) : NEW relation: purchase.order -# DONE: post-migration: group purchases by their requisition if it has the deleted type "purchase_requisition.type_multi" +# DONE: post-migration: group purchases by their requisition if there's more than one PO per requisition new model purchase.requisition.alternative.warning [transient] new model purchase.requisition.create.alternative [transient] From 92d4387c74a532c9f0b64590d2467deb33e76132 Mon Sep 17 00:00:00 2001 From: FernandoRomera Date: Tue, 2 Sep 2025 14:15:02 +0200 Subject: [PATCH 37/51] [OU-IMP] account: performance --- .../scripts/account/16.0.1.2/pre-migration.py | 42 +++++++++---------- 1 file changed, 21 insertions(+), 21 deletions(-) diff --git a/openupgrade_scripts/scripts/account/16.0.1.2/pre-migration.py b/openupgrade_scripts/scripts/account/16.0.1.2/pre-migration.py index 1b1db1552625..5dc77f60c133 100644 --- a/openupgrade_scripts/scripts/account/16.0.1.2/pre-migration.py +++ b/openupgrade_scripts/scripts/account/16.0.1.2/pre-migration.py @@ -224,27 +224,27 @@ def _account_move_fast_fill_display_type(env): openupgrade.logged_query( env.cr, """ - WITH sub AS ( - SELECT - aml.id, - CASE - WHEN am.move_type NOT IN - ('out_invoice', 'out_refund', 'in_invoice', 'in_refund') - THEN 'product' - WHEN aml.tax_line_id IS NOT NULL THEN 'tax' - WHEN aa.account_type IN - ('asset_receivable', 'liability_payable') THEN 'payment_term' - ELSE 'product' - END AS display_type - FROM account_move_line AS aml - LEFT JOIN account_move AS am ON am.id = aml.move_id - LEFT JOIN account_account AS aa ON aa.id = aml.account_id - WHERE aml.display_type IS NULL AND am.id = aml.move_id - ) - UPDATE account_move_line AS aml - SET display_type = sub.display_type - FROM sub - WHERE aml.id = sub.id; + UPDATE + account_move_line AS aml2 + SET + display_type = COALESCE(( + SELECT + CASE WHEN am.move_type NOT IN ('out_invoice', 'out_refund', 'in_invoice', 'in_refund') THEN + 'product' + WHEN aml.tax_line_id IS NOT NULL THEN + 'tax' + WHEN aa.account_type IN ('asset_receivable', 'liability_payable') THEN + 'payment_term' + ELSE + 'product' + END AS display_type + FROM account_move_line AS aml + INNER JOIN account_move AS am ON am.id = aml.move_id + INNER JOIN account_account AS aa ON aa.id = aml.account_id + WHERE + aml.id = aml2.id), 'product') + WHERE + aml2.display_type IS NULL; """, ) # Extra actions: set quantity = 0 for lines of type tax or payment_term according From bc6a9fa057344d9cd1ddb00a303883d483b77b17 Mon Sep 17 00:00:00 2001 From: Alexis de Lattre Date: Thu, 2 Oct 2025 17:10:17 +0200 Subject: [PATCH 38/51] [FIX] Crash when company_registry already exists on res_partner The bug happens when the module l10n_fr_siret from OCA/l10n-france is already installed. --- openupgrade_scripts/scripts/base/16.0.1.3/pre-migration.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/openupgrade_scripts/scripts/base/16.0.1.3/pre-migration.py b/openupgrade_scripts/scripts/base/16.0.1.3/pre-migration.py index bebe446891a6..1d78685a4b91 100644 --- a/openupgrade_scripts/scripts/base/16.0.1.3/pre-migration.py +++ b/openupgrade_scripts/scripts/base/16.0.1.3/pre-migration.py @@ -169,6 +169,8 @@ def migrate(cr, version): "WHERE r.view_id=v.id AND v.inherit_id IS NOT NULL AND v.mode != 'primary'" ) # pre-create res.partner~company_registry - openupgrade.logged_query(cr, "ALTER TABLE res_partner ADD company_registry VARCHAR") + openupgrade.logged_query( + cr, "ALTER TABLE res_partner ADD IF NOT EXISTS company_registry VARCHAR" + ) # update all translatable fields update_translatable_fields(cr) From f47c054efbdb9e82ecfe7f29ef7789c105566b6e Mon Sep 17 00:00:00 2001 From: Carlos Lopez Date: Wed, 15 Oct 2025 13:49:30 -0500 Subject: [PATCH 39/51] [OU-ADD] queue_job_context: Merged into queue_job --- openupgrade_scripts/apriori.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/openupgrade_scripts/apriori.py b/openupgrade_scripts/apriori.py index b6d9afdd8459..90cfd4fe8346 100644 --- a/openupgrade_scripts/apriori.py +++ b/openupgrade_scripts/apriori.py @@ -117,6 +117,8 @@ "product_form_purchase_link": "purchase", "purchase_order_line_price_history": "purchase", "purchase_picking_state": "purchase_stock", + # OCA/queue + "queue_job_context": "queue_job", # OCA/sale-promotion "coupon_commercial_partner_applicability": "loyalty_partner_applicability", "sale_coupon_selection_wizard": "sale_loyalty_order_suggestion", From 694dbee5286bdc3222914c14f67541bd6c547b93 Mon Sep 17 00:00:00 2001 From: Sylvain LE GAL Date: Sat, 22 Feb 2025 00:59:03 +0100 Subject: [PATCH 40/51] [OU-ADD] apriori: pos_cashback_warning renamed into pos_cashback https://github.com/OCA/pos/pull/1320 --- openupgrade_scripts/apriori.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/openupgrade_scripts/apriori.py b/openupgrade_scripts/apriori.py index 90cfd4fe8346..59551f13dcdd 100644 --- a/openupgrade_scripts/apriori.py +++ b/openupgrade_scripts/apriori.py @@ -34,6 +34,8 @@ "knowledge": "document_knowledge", # OCA/multi-company "res_partner_category_multi_company": "partner_category_multi_company", + # OCA/pos + "pos_cashback_warning": "pos_cashback", # OCA/product-attribute "product_packaging_type": "product_packaging_level", # OCA/project From aab68a92e77276368a395f0f7c1b10e82c176f52 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20Ba=C3=B1=C3=B3n?= Date: Thu, 12 Feb 2026 19:49:22 +0100 Subject: [PATCH 41/51] [OU-ADD] apriori: account_bank_statement_reopen_skip_undo_reconciliation merged into account_statement_base TT60387 --- openupgrade_scripts/apriori.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/openupgrade_scripts/apriori.py b/openupgrade_scripts/apriori.py index 59551f13dcdd..74700c1e099a 100644 --- a/openupgrade_scripts/apriori.py +++ b/openupgrade_scripts/apriori.py @@ -100,6 +100,8 @@ "account_invoice_search_by_reference": "account", # OCA/account-invoice-reporting "account_invoice_report_due_list": "account", + # OCA/account-reconcile + "account_bank_statement_reopen_skip_undo_reconciliation": "account_statement_base", # OCA/e-commerce "website_sale_require_login": "website_sale", # OCA/l10n-spain From 2aa6877c0cfff7e3189e0ee4dbae793032aaf611 Mon Sep 17 00:00:00 2001 From: Sylvain LE GAL Date: Tue, 28 Apr 2026 22:53:01 +0200 Subject: [PATCH 42/51] [ADD] pos_sale_order_load renamed into pos_picking_load. Rational: - pos_picking_load exists in V8 and V12. - in v14, pos_sale_order_load is developped. (comes from odoo/odoo code, #1142) - in V16, pos_picking_load is ported from V12. --- openupgrade_scripts/apriori.py | 1 + 1 file changed, 1 insertion(+) diff --git a/openupgrade_scripts/apriori.py b/openupgrade_scripts/apriori.py index 74700c1e099a..2233a07a73e9 100644 --- a/openupgrade_scripts/apriori.py +++ b/openupgrade_scripts/apriori.py @@ -36,6 +36,7 @@ "res_partner_category_multi_company": "partner_category_multi_company", # OCA/pos "pos_cashback_warning": "pos_cashback", + "pos_sale_order_load": "pos_picking_load", # OCA/product-attribute "product_packaging_type": "product_packaging_level", # OCA/project From dc9556db3b3bb2c9dfbf5be972082bdef739e4a5 Mon Sep 17 00:00:00 2001 From: hugues de keyzer Date: Fri, 22 May 2026 19:33:22 +0200 Subject: [PATCH 43/51] [FIX] fix pos.session cash register amounts ensure that the account.bank.statement record corresponding to the cash journal is used to set the value of the cash register fields, as there can be multiple records linked to the pos.session (one per payment method), and ensure that the values are not null. --- .../point_of_sale/16.0.1.0.1/post-migration.py | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/openupgrade_scripts/scripts/point_of_sale/16.0.1.0.1/post-migration.py b/openupgrade_scripts/scripts/point_of_sale/16.0.1.0.1/post-migration.py index b52597b685e1..2861f67b533b 100644 --- a/openupgrade_scripts/scripts/point_of_sale/16.0.1.0.1/post-migration.py +++ b/openupgrade_scripts/scripts/point_of_sale/16.0.1.0.1/post-migration.py @@ -27,11 +27,16 @@ def copy_register_balance(cr): openupgrade.logged_query( cr, """ - UPDATE pos_session session - SET cash_register_balance_end_real=statement.balance_end_real, - cash_register_balance_start=statement.balance_start - FROM account_bank_statement statement - WHERE statement.pos_session_id=session.id + update pos_session as ps + set + cash_register_balance_end_real = coalesce(abs.balance_end_real, 0), + cash_register_balance_start = coalesce(abs.balance_start, 0) + from pos_session as ps2 + left outer join account_bank_statement as abs on + abs.pos_session_id = ps2.id and + abs.journal_id = ps2.cash_journal_id + where + ps2.id = ps.id """, ) From bd206f072d1da9352e9768b98c177b4202dce36d Mon Sep 17 00:00:00 2001 From: Carlos Roca Date: Fri, 12 Jun 2026 15:38:27 +0200 Subject: [PATCH 44/51] [IMP] account: migrate bank statement chatter attachments to attachment_ids In Odoo 16, account.bank.statement gains a new attachment_ids many2many field to ir.attachment. Add a post-migration query that links the existing chatter attachments (ir.attachment with res_model = 'account.bank.statement') into this field. --- .../scripts/account/16.0.1.2/post-migration.py | 18 ++++++++++++++++++ .../account/16.0.1.2/upgrade_analysis_work.txt | 2 +- 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/openupgrade_scripts/scripts/account/16.0.1.2/post-migration.py b/openupgrade_scripts/scripts/account/16.0.1.2/post-migration.py index 203c49af3880..34a4dd824e13 100644 --- a/openupgrade_scripts/scripts/account/16.0.1.2/post-migration.py +++ b/openupgrade_scripts/scripts/account/16.0.1.2/post-migration.py @@ -32,6 +32,23 @@ ] +def _fill_account_bank_statement_attachment_ids(env): + """The chatter attachments of the bank statements are now linked through + the new `attachment_ids` many2many field, so we fill it with the existing ones. + """ + openupgrade.logged_query( + env.cr, + """ + INSERT INTO account_bank_statement_ir_attachment_rel + (account_bank_statement_id, ir_attachment_id) + SELECT ia.res_id, ia.id + FROM account_bank_statement abs + JOIN ir_attachment ia ON abs.id = ia.res_id + WHERE ia.res_model = 'account.bank.statement' + """, + ) + + def _compute_remaining_account_payment_amount_company_currency_signed(env): """Those payment with different currency than the company ones are not easily computed by SQL, so we use ORM for these cases, but they should luckily be few. @@ -50,6 +67,7 @@ def migrate(env, version): env, _deleted_xml_records, ) + _fill_account_bank_statement_attachment_ids(env) _compute_remaining_account_payment_amount_company_currency_signed(env) # credit_limit converted to company dependent old_column = openupgrade.get_legacy_name("credit_limit") diff --git a/openupgrade_scripts/scripts/account/16.0.1.2/upgrade_analysis_work.txt b/openupgrade_scripts/scripts/account/16.0.1.2/upgrade_analysis_work.txt index 6ac54218455d..50195d5dca54 100644 --- a/openupgrade_scripts/scripts/account/16.0.1.2/upgrade_analysis_work.txt +++ b/openupgrade_scripts/scripts/account/16.0.1.2/upgrade_analysis_work.txt @@ -97,7 +97,7 @@ account / account.bank.statement / _order : _order # NOTHING TO DO account / account.bank.statement / attachment_ids (many2many) : NEW relation: ir.attachment -# Put in this field existing chatter attachments? +# DONE: post-migration: fill this field with the existing chatter attachments account / account.bank.statement / cashbox_end_id (many2one) : DEL relation: account.bank.statement.cashbox account / account.bank.statement / cashbox_start_id (many2one) : DEL relation: account.bank.statement.cashbox From 185652f48ba0735adcded305dfd87b1947d06bf0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20Ba=C3=B1=C3=B3n?= Date: Tue, 7 Jul 2026 09:53:24 +0200 Subject: [PATCH 45/51] [IMP] base: Load additional renames/merges from env. Backport of https://github.com/OCA/OpenUpgrade/pull/5765 TT63118 @Tecnativa --- .../scripts/base/16.0.1.3/pre-migration.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/openupgrade_scripts/scripts/base/16.0.1.3/pre-migration.py b/openupgrade_scripts/scripts/base/16.0.1.3/pre-migration.py index 1d78685a4b91..588a4faa43f2 100644 --- a/openupgrade_scripts/scripts/base/16.0.1.3/pre-migration.py +++ b/openupgrade_scripts/scripts/base/16.0.1.3/pre-migration.py @@ -159,8 +159,12 @@ def migrate(cr, version): ) login_or_registration_required_at_checkout(cr) enable_coupon_sharing_within_entity(cr) - openupgrade.update_module_names(cr, renamed_modules.items()) - openupgrade.update_module_names(cr, merged_modules.items(), merge_modules=True) + openupgrade.update_module_names( + cr, renamed_modules.items(), environment_namespec=True + ) + openupgrade.update_module_names( + cr, merged_modules.items(), merge_modules=True, environment_namespec=True + ) openupgrade.clean_transient_models(cr) # restricting inherited views to groups isn't allowed anymore cr.execute( From 6054982e166c51bfb14667eaf7805c4f6dbe1368 Mon Sep 17 00:00:00 2001 From: Pilar Vargas Date: Thu, 9 Jul 2026 13:29:04 +0200 Subject: [PATCH 46/51] [OU-ADD] mass_mailing_themes: Nothing to do TT63294 --- docsource/modules150-160.rst | 2 +- .../16.0.1.1/upgrade_analysis_work.txt | 11 +++++++++++ 2 files changed, 12 insertions(+), 1 deletion(-) create mode 100644 openupgrade_scripts/scripts/mass_mailing_themes/16.0.1.1/upgrade_analysis_work.txt diff --git a/docsource/modules150-160.rst b/docsource/modules150-160.rst index a3ade2d40150..8fd945f89119 100644 --- a/docsource/modules150-160.rst +++ b/docsource/modules150-160.rst @@ -558,7 +558,7 @@ Module coverage 15.0 -> 16.0 +-------------------------------------------------+----------------------+-------------------------------------------------+ | mass_mailing_sms | |No DB layout changes. | +-------------------------------------------------+----------------------+-------------------------------------------------+ -| |new| mass_mailing_themes | | | +| |new| mass_mailing_themes | Nothing to do | | +-------------------------------------------------+----------------------+-------------------------------------------------+ | membership | Nothing to do |No DB layout changes. | +-------------------------------------------------+----------------------+-------------------------------------------------+ diff --git a/openupgrade_scripts/scripts/mass_mailing_themes/16.0.1.1/upgrade_analysis_work.txt b/openupgrade_scripts/scripts/mass_mailing_themes/16.0.1.1/upgrade_analysis_work.txt new file mode 100644 index 000000000000..16a8001a7391 --- /dev/null +++ b/openupgrade_scripts/scripts/mass_mailing_themes/16.0.1.1/upgrade_analysis_work.txt @@ -0,0 +1,11 @@ +---Models in module 'mass_mailing_themes'--- +---Fields in module 'mass_mailing_themes'--- +---XML records in module 'mass_mailing_themes'--- +NEW ir.ui.view: mass_mailing_themes.email_designer_snippets +NEW ir.ui.view: mass_mailing_themes.theme_bignews_template +NEW ir.ui.view: mass_mailing_themes.theme_bold_template +NEW ir.ui.view: mass_mailing_themes.theme_newsletter_template +NEW ir.ui.view: mass_mailing_themes.theme_solar_template +NEW ir.ui.view: mass_mailing_themes.theme_tech_template +NEW ir.ui.view: mass_mailing_themes.theme_vip_template +# NOTHING TO DO: new module containing only predefined mailing theme views From dccee823c87f7e303e0af901b6d36de0dc1b5657 Mon Sep 17 00:00:00 2001 From: Julien Guenat <50988819+jguenat@users.noreply.github.com> Date: Wed, 15 Jul 2026 18:20:22 +0200 Subject: [PATCH 47/51] [IMP] point_of_sale: remove 15.0 noupdate rule rule_pos_bank_statement_user rule does not exist anymore in version 16.0 --- .../scripts/point_of_sale/16.0.1.0.1/post-migration.py | 1 + .../point_of_sale/16.0.1.0.1/upgrade_analysis_work.txt | 4 +--- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/openupgrade_scripts/scripts/point_of_sale/16.0.1.0.1/post-migration.py b/openupgrade_scripts/scripts/point_of_sale/16.0.1.0.1/post-migration.py index 2861f67b533b..8e0581e21692 100644 --- a/openupgrade_scripts/scripts/point_of_sale/16.0.1.0.1/post-migration.py +++ b/openupgrade_scripts/scripts/point_of_sale/16.0.1.0.1/post-migration.py @@ -49,6 +49,7 @@ def migrate(env, version): env, [ "point_of_sale.rule_pos_cashbox_line_accountant", + "point_of_sale.rule_pos_bank_statement_user", "point_of_sale.500_00", ], ) diff --git a/openupgrade_scripts/scripts/point_of_sale/16.0.1.0.1/upgrade_analysis_work.txt b/openupgrade_scripts/scripts/point_of_sale/16.0.1.0.1/upgrade_analysis_work.txt index 74767f5a7ca1..f944791fd8ff 100644 --- a/openupgrade_scripts/scripts/point_of_sale/16.0.1.0.1/upgrade_analysis_work.txt +++ b/openupgrade_scripts/scripts/point_of_sale/16.0.1.0.1/upgrade_analysis_work.txt @@ -79,10 +79,8 @@ DEL ir.model.access: point_of_sale.access_money_in_out_wizard # NOTHING TO DO: the relevant models no longer exist DEL ir.rule: point_of_sale.rule_pos_bank_statement_user (noupdate) -# NOTHING TO DO: pos_session_id no longer stored on account.bank.statement. - DEL ir.rule: point_of_sale.rule_pos_cashbox_line_accountant (noupdate) -# DONE: post-migration: Remove safely the rule +# DONE: post-migration: Remove safely the rules DEL ir.ui.menu: point_of_sale.menu_pos_config_pos NEW ir.ui.view: point_of_sale.ticket_validation_screen From 928b51d72ef6372510263417bf6f612fcee5a0c4 Mon Sep 17 00:00:00 2001 From: "cristina.hidalgo" Date: Fri, 4 Sep 2026 14:36:45 +0200 Subject: [PATCH 48/51] [OU-IMP] website: reset unmodified COW templates to upstream Call cow_templates_mark_if_equal_to_upstream() in the pre-migration and cow_templates_replicate_upstream() in the end-migration. A website that enables an optional template through the Customize widget but never edits it keeps a COW copy; until now that copy was never resynced on migration, so it kept the origin arch_db and inherit_id. When a module migration re-targets which template the view inherits from, the stale copy points at the old parent and breaks rendering, as seen with website_sale_product_attribute_filter_category when website_sale moved a template between versions. cow_templates_replicate_upstream() also propagates inherit_id since OCA/openupgradelib#463. TT64160 --- openupgrade_scripts/scripts/website/16.0.1.0/end-migration.py | 1 + openupgrade_scripts/scripts/website/16.0.1.0/pre-migration.py | 1 + 2 files changed, 2 insertions(+) diff --git a/openupgrade_scripts/scripts/website/16.0.1.0/end-migration.py b/openupgrade_scripts/scripts/website/16.0.1.0/end-migration.py index 43f106d8d67a..12cd5c69641b 100644 --- a/openupgrade_scripts/scripts/website/16.0.1.0/end-migration.py +++ b/openupgrade_scripts/scripts/website/16.0.1.0/end-migration.py @@ -115,3 +115,4 @@ def migrate(env, version): convert_custom_qweb_templates_bootstrap_4to5(env) convert_field_html_string_bootstrap_4to5(env) rename_t_group_website_restricted_editor(env) + openupgrade.cow_templates_replicate_upstream(env.cr) diff --git a/openupgrade_scripts/scripts/website/16.0.1.0/pre-migration.py b/openupgrade_scripts/scripts/website/16.0.1.0/pre-migration.py index 62266c118b8c..083e36d741e4 100644 --- a/openupgrade_scripts/scripts/website/16.0.1.0/pre-migration.py +++ b/openupgrade_scripts/scripts/website/16.0.1.0/pre-migration.py @@ -149,3 +149,4 @@ def migrate(env, version): _fill_homepage_url(env) _mig_s_progress_steps_contents(env) _reset_customize_show_in_website_views(env) + openupgrade.cow_templates_mark_if_equal_to_upstream(env.cr) From 93eef0e28853f6150211df90bf35786925f635ad Mon Sep 17 00:00:00 2001 From: Roy Le Date: Tue, 29 Sep 2026 16:40:06 +0700 Subject: [PATCH 49/51] [IMP] base: delete the technical records of the modules removed without a successor apriori.lost_modules lists the modules merged into the module they extended because they have no source any more. Before the merge, their technical noupdate records (rules, scheduled and server actions, views, menus, mail templates) are released so that the update deletes them, and the xml ids of the records of models that go with the module are detached. Business records stay. --- openupgrade_scripts/apriori.py | 9 +++ .../scripts/base/16.0.1.3/pre-migration.py | 59 +++++++++++++++++++ 2 files changed, 68 insertions(+) diff --git a/openupgrade_scripts/apriori.py b/openupgrade_scripts/apriori.py index 9ecca5e9e063..0be6ecd37985 100644 --- a/openupgrade_scripts/apriori.py +++ b/openupgrade_scripts/apriori.py @@ -290,3 +290,12 @@ # Viindoo/enterprise # Viindoo/odoo-tvtma } + +# Modules of merged_modules that are not merged into anything: they are +# removed without a successor on our addons paths. The technical records they +# own (record rules, scheduled and server actions, views, menus, mail +# templates...) are deleted by the update even when they are noupdate, and the +# xml ids of records of models that go with them are detached: see +# release_records_of_lost_modules in the pre-migration of base. +lost_modules = [ +] diff --git a/openupgrade_scripts/scripts/base/16.0.1.3/pre-migration.py b/openupgrade_scripts/scripts/base/16.0.1.3/pre-migration.py index 425a35ef1504..447545088d6b 100644 --- a/openupgrade_scripts/scripts/base/16.0.1.3/pre-migration.py +++ b/openupgrade_scripts/scripts/base/16.0.1.3/pre-migration.py @@ -170,6 +170,64 @@ def update_translatable_fields(cr): ) +_TECHNICAL_MODELS = ( + "ir.actions.act_url", + "ir.actions.act_window", + "ir.actions.client", + "ir.actions.report", + "ir.actions.server", + "ir.actions.todo", + "ir.cron", + "ir.filters", + "ir.model.access", + "ir.property", + "ir.rule", + "ir.ui.menu", + "ir.ui.view", + "mail.template", + "website.menu", +) + + +def release_records_of_lost_modules(cr): + """A module that is removed without a successor is merged into the module + it extended (apriori.lost_modules), and the update of that module deletes + the records it no longer finds in the data files, except the noupdate + ones: release the technical records, so that they are deleted too, and + detach the xml ids of the records of models that go with the module (the + rows stay). Business records stay. + """ + from odoo.addons.openupgrade_scripts import apriori as _apriori + + lost_modules = tuple(getattr(_apriori, "lost_modules", [])) + if not lost_modules: + return + openupgrade.logged_query( + cr, + """ + UPDATE ir_model_data SET noupdate = FALSE + WHERE noupdate AND module IN %s AND model IN %s + """, + (lost_modules, _TECHNICAL_MODELS), + ) + openupgrade.logged_query( + cr, + """ + DELETE FROM ir_model_data d + WHERE d.module IN %s AND d.model IN ( + SELECT m.model + FROM ir_model m + JOIN ir_model_data md ON md.model = 'ir.model' + AND md.res_id = m.id AND md.module IN %s + WHERE NOT EXISTS ( + SELECT 1 FROM ir_model_data o + WHERE o.model = 'ir.model' AND o.res_id = m.id + AND o.module NOT IN %s)) + """, + (lost_modules,) * 3, + ) + + @openupgrade.migrate(use_env=False) def migrate(cr, version): """ @@ -185,6 +243,7 @@ def migrate(cr, version): ) login_or_registration_required_at_checkout(cr) enable_coupon_sharing_within_entity(cr) + release_records_of_lost_modules(cr) openupgrade.update_module_names( cr, renamed_modules.items(), environment_namespec=True ) From d03d93d5a865d2739e4f85d1612ad52b530f0364 Mon Sep 17 00:00:00 2001 From: Roy Le Date: Wed, 30 Sep 2026 12:33:28 +0700 Subject: [PATCH 50/51] [FIX] openupgrade_framework: delete the archived children of a removed view The end of an update deletes the views its module no longer ships under the module uninstall flag, and the core cascades to the children through inherit_children_ids, which leaves out the archived ones (e.g. an option of the website editor turned off). Their foreign key then keeps the parent from being deleted: 'violates foreign key constraint ir_ui_view_inherit_id_fkey' (website_sale.payment_footer at 17.0). Same fix as in the 10.0-13.0 forks. --- .../odoo/addons/base/models/ir_ui_view.py | 23 +++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/openupgrade_framework/odoo_patch/odoo/addons/base/models/ir_ui_view.py b/openupgrade_framework/odoo_patch/odoo/addons/base/models/ir_ui_view.py index 4860c1d25645..3decbfbdc83e 100644 --- a/openupgrade_framework/odoo_patch/odoo/addons/base/models/ir_ui_view.py +++ b/openupgrade_framework/odoo_patch/odoo/addons/base/models/ir_ui_view.py @@ -86,3 +86,26 @@ def _raise_view_error( NameManager.check = check _raise_view_error._original_method = View._raise_view_error View._raise_view_error = _raise_view_error + + +def unlink(self): + """Remove the archived children of a view deleted with its module too. + + The cascade of the core (under the module uninstall flag, which the end of + an update sets) goes through inherit_children_ids, which leaves out the + archived views (e.g. an option of the website editor turned off): their + foreign key then keeps the parent from being deleted, and the log shows + 'violates foreign key constraint ir_ui_view_inherit_id_fkey'. + """ + if self.env.context.get("_force_unlink"): + archived = ( + self.with_context(active_test=False).inherit_children_ids + - self.inherit_children_ids + ) + if archived: + archived.unlink() + return unlink._original_method(self) + + +unlink._original_method = View.unlink +View.unlink = unlink From f915c3c1f01ac253cc4213ad4135a705295448a3 Mon Sep 17 00:00:00 2001 From: Roy Le Date: Thu, 1 Oct 2026 17:34:58 +0700 Subject: [PATCH 51/51] [FIX] openupgrade_framework: release the savepoint of each obsolete record The unlink patch opened a savepoint for every obsolete record deleted by _process_end and never released it (its name was even the same for all, str(uuid4) instead of str(uuid4())). Each open savepoint that deletes keeps a transactionid lock until the end of the update: a large update holds thousands of them, and with another update running on the cluster the lock table ran out ("out of shared memory", hop 17.0 of a real database). Release the savepoint after the delete, and after the rollback when it fails: 200 deletions now hold 1 lock instead of 201. --- openupgrade_framework/odoo_patch/odoo/models.py | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/openupgrade_framework/odoo_patch/odoo/models.py b/openupgrade_framework/odoo_patch/odoo/models.py index 1f008ec4667d..378e283ddb1e 100644 --- a/openupgrade_framework/odoo_patch/odoo/models.py +++ b/openupgrade_framework/odoo_patch/odoo/models.py @@ -21,16 +21,26 @@ def unlink(self): """ if not self.env.context.get(MODULE_UNINSTALL_FLAG): return BaseModel.unlink._original_method(self) - savepoint = str(uuid4) + savepoint = str(uuid4()) try: self.env.cr.execute( # pylint: disable=sql-injection 'SAVEPOINT "%s"' % savepoint ) - return BaseModel.unlink._original_method(self) + result = BaseModel.unlink._original_method(self) + # release it: a savepoint left open per deleted record keeps a + # transactionid lock until the end of the update, enough to exhaust + # the lock table of the cluster on a large update + self.env.cr.execute( # pylint: disable=sql-injection + 'RELEASE SAVEPOINT "%s"' % savepoint + ) + return result except Exception as e: self.env.cr.execute( # pylint: disable=sql-injection 'ROLLBACK TO SAVEPOINT "%s"' % savepoint ) + self.env.cr.execute( # pylint: disable=sql-injection + 'RELEASE SAVEPOINT "%s"' % savepoint + ) _logger.warning( "Could not delete obsolete record with ids %s of model %s: %s", self.ids,