From 2c832e78f92e29fe4b6ccc44dfe487df85871fe5 Mon Sep 17 00:00:00 2001 From: Pilar Vargas Date: Tue, 27 Oct 2026 09:34:20 +0100 Subject: [PATCH] [FIX] event_sale: preserve event product types during migration TT65365 --- docsource/modules170-180.rst | 2 +- .../18.0.1.0/upgrade_analysis_work.txt | 4 +++- .../event_sale/18.0.1.3/pre-migration.py | 17 +++++++++++++++++ .../18.0.1.3/upgrade_analysis_work.txt | 4 +++- 4 files changed, 24 insertions(+), 3 deletions(-) create mode 100644 openupgrade_scripts/scripts/event_sale/18.0.1.3/pre-migration.py diff --git a/docsource/modules170-180.rst b/docsource/modules170-180.rst index 6c4f5d8d7ccb..b24c9b03388d 100644 --- a/docsource/modules170-180.rst +++ b/docsource/modules170-180.rst @@ -152,7 +152,7 @@ Module coverage 17.0 -> 18.0 +---------------------------------------------------+----------------------+-------------------------------------------------+ | |new| event_product |Done | | +---------------------------------------------------+----------------------+-------------------------------------------------+ -| event_sale |Nothing to do | | +| event_sale |Done | | +---------------------------------------------------+----------------------+-------------------------------------------------+ | event_sms |Done |No DB layout changes. | +---------------------------------------------------+----------------------+-------------------------------------------------+ diff --git a/openupgrade_scripts/scripts/event_product/18.0.1.0/upgrade_analysis_work.txt b/openupgrade_scripts/scripts/event_product/18.0.1.0/upgrade_analysis_work.txt index 7dde56662b79..077bbc827385 100644 --- a/openupgrade_scripts/scripts/event_product/18.0.1.0/upgrade_analysis_work.txt +++ b/openupgrade_scripts/scripts/event_product/18.0.1.0/upgrade_analysis_work.txt @@ -16,9 +16,11 @@ event_product / event.type.ticket / price (float) : previ event_product / event.type.ticket / price_reduce (float) : previously in module event_sale event_product / event.type.ticket / product_id (many2one) : previously in module event_sale event_product / product.product / event_ticket_ids (one2many) : previously in module event_sale -event_product / product.template / service_tracking (False) : NEW selection_keys: ['event', 'no'], mode: modify # NOTHING TO DO: Moved to this module, and handled by ORM (doing the field/model XML-IDs renaming) +event_product / product.template / service_tracking (False) : NEW selection_keys: ['event', 'no'], mode: modify +# NOTHING TO DO: Handled in event_sale migration + ---XML records in module 'event_product'--- NEW ir.ui.view: event_product.event_event_ticket_form_view NEW ir.ui.view: event_product.event_event_ticket_view_form_from_event diff --git a/openupgrade_scripts/scripts/event_sale/18.0.1.3/pre-migration.py b/openupgrade_scripts/scripts/event_sale/18.0.1.3/pre-migration.py new file mode 100644 index 000000000000..2270f03712b9 --- /dev/null +++ b/openupgrade_scripts/scripts/event_sale/18.0.1.3/pre-migration.py @@ -0,0 +1,17 @@ +# Copyright 2026 Tecnativa - Pilar Vargas +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). + +from openupgradelib import openupgrade + + +@openupgrade.migrate() +def migrate(env, version): + # Preserve event products by migrating their type to service tracking. + openupgrade.logged_query( + env.cr, + """ + UPDATE product_template + SET service_tracking = 'event' + WHERE detailed_type = 'event' + """, + ) diff --git a/openupgrade_scripts/scripts/event_sale/18.0.1.3/upgrade_analysis_work.txt b/openupgrade_scripts/scripts/event_sale/18.0.1.3/upgrade_analysis_work.txt index e514de4d170b..e674909664cc 100644 --- a/openupgrade_scripts/scripts/event_sale/18.0.1.3/upgrade_analysis_work.txt +++ b/openupgrade_scripts/scripts/event_sale/18.0.1.3/upgrade_analysis_work.txt @@ -16,9 +16,11 @@ event_sale / event.type.ticket / price (float) : module event_sale / event.type.ticket / price_reduce (float) : module is now 'event_product' ('event_sale') event_sale / event.type.ticket / product_id (many2one) : module is now 'event_product' ('event_sale') event_sale / product.product / event_ticket_ids (one2many) : module is now 'event_product' ('event_sale') -event_sale / product.template / detailed_type (False) : DEL selection_keys: ['combo', 'consu', 'event', 'product', 'service'], mode: modify # NOTHING TO DO: Module changed handled by ORM +event_sale / product.template / detailed_type (False) : DEL selection_keys: ['combo', 'consu', 'event', 'product', 'service'], mode: modify +# DONE: pre-migration: Assign this new value to products with detailed_type='event' + ---XML records in module 'event_sale'--- NEW ir.ui.view: event_sale.product_template_form_view DEL ir.ui.view: event_sale.event_event_ticket_form_view