From ba51b98112c66d1ba0ebb1feea72f5ab29f37320 Mon Sep 17 00:00:00 2001 From: Carlos Lopez Date: Mon, 13 Jul 2026 10:24:17 -0500 Subject: [PATCH] [OU-ADD] website_event_track: Migration scripts --- docsource/modules180-190.rst | 2 +- .../19.0.1.3/post-migration.py | 15 +++++++++++ .../19.0.1.3/pre-migration.py | 25 +++++++++++++++++++ .../19.0.1.3/upgrade_analysis_work.txt | 21 ++++++++++++++++ 4 files changed, 62 insertions(+), 1 deletion(-) create mode 100644 openupgrade_scripts/scripts/website_event_track/19.0.1.3/post-migration.py create mode 100644 openupgrade_scripts/scripts/website_event_track/19.0.1.3/pre-migration.py create mode 100644 openupgrade_scripts/scripts/website_event_track/19.0.1.3/upgrade_analysis_work.txt diff --git a/docsource/modules180-190.rst b/docsource/modules180-190.rst index 9707ec897c4a..13bed94c0cb9 100644 --- a/docsource/modules180-190.rst +++ b/docsource/modules180-190.rst @@ -1166,7 +1166,7 @@ Module coverage 18.0 -> 19.0 +---------------------------------------------------+----------------------+-------------------------------------------------+ | website_event_sale | | | +---------------------------------------------------+----------------------+-------------------------------------------------+ -| website_event_track | | | +| website_event_track |Done | | +---------------------------------------------------+----------------------+-------------------------------------------------+ | website_event_track_live | | | +---------------------------------------------------+----------------------+-------------------------------------------------+ diff --git a/openupgrade_scripts/scripts/website_event_track/19.0.1.3/post-migration.py b/openupgrade_scripts/scripts/website_event_track/19.0.1.3/post-migration.py new file mode 100644 index 000000000000..52441d6809f6 --- /dev/null +++ b/openupgrade_scripts/scripts/website_event_track/19.0.1.3/post-migration.py @@ -0,0 +1,15 @@ +# Copyright 2026 Tecnativa - Carlos Lopez +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). + +from openupgradelib import openupgrade + + +@openupgrade.migrate() +def migrate(env, version): + openupgrade.load_data(env, "website_event_track", "19.0.1.3/noupdate_changes.xml") + openupgrade.delete_record_translations( + env.cr, + "website_event_track", + ["mail_template_data_track_confirmation"], + ["body_html"], + ) diff --git a/openupgrade_scripts/scripts/website_event_track/19.0.1.3/pre-migration.py b/openupgrade_scripts/scripts/website_event_track/19.0.1.3/pre-migration.py new file mode 100644 index 000000000000..92c7777296d5 --- /dev/null +++ b/openupgrade_scripts/scripts/website_event_track/19.0.1.3/pre-migration.py @@ -0,0 +1,25 @@ +# Copyright 2026 Tecnativa - Carlos Lopez +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). + +from openupgradelib import openupgrade + +_new_columns = [("event.track", "is_seo_optimized", "boolean", False, "event_track")] + + +def _fill_event_track_is_seo_optimized(env): + openupgrade.logged_query( + env.cr, + """ + UPDATE event_track + SET is_seo_optimized = True + WHERE website_meta_title IS NOT NULL + AND website_meta_description IS NOT NULL + AND website_meta_keywords IS NOT NULL + """, + ) + + +@openupgrade.migrate() +def migrate(env, version): + openupgrade.add_columns(env, _new_columns) + _fill_event_track_is_seo_optimized(env) diff --git a/openupgrade_scripts/scripts/website_event_track/19.0.1.3/upgrade_analysis_work.txt b/openupgrade_scripts/scripts/website_event_track/19.0.1.3/upgrade_analysis_work.txt new file mode 100644 index 000000000000..9e25180bcc81 --- /dev/null +++ b/openupgrade_scripts/scripts/website_event_track/19.0.1.3/upgrade_analysis_work.txt @@ -0,0 +1,21 @@ +---Models in module 'website_event_track'--- +---Fields in module 'website_event_track'--- +website_event_track / event.track / _order : _order is now 'priority desc, date' ('priority, date') +# NOTHING TO DO: the new order reflects the expected behavior; +# no logic changes were made in https://github.com/odoo/odoo/pull/220949 + +website_event_track / event.track / date (datetime) : now a function +# NOTHING TO DO: the field is still stored + +website_event_track / event.track / is_seo_optimized (boolean) : is now stored +# DONE: pre-migration: Pre-created and populated this field. + +website_event_track / website.event.menu / menu_type (False) : selection_keys added: [exhibitor, other], removed: [location] +# NOTHING TO DO: handled by the migration scripts in the website_event module + +---XML records in module 'website_event_track'--- +NEW ir.asset: website_event_track.s_searchbar_000_xml +NEW ir.ui.view: website_event_track.track_list_item +DEL ir.ui.view: website_event_track.snippet_options +NEW mail.template: website_event_track.mail_template_data_track_reminder (noupdate) +# NOTHING TO DO: Handled by ORM