From d3cb0b647e361a60c0d248595b2b54d0d8a69e46 Mon Sep 17 00:00:00 2001 From: Diamond Nguyen Date: Sat, 1 Jul 2023 16:12:42 +0700 Subject: [PATCH 1/2] [OU-ADD] event_booth_sale: Nothing to do --- docsource/modules150-160.rst | 2 +- .../16.0.1.1/upgrade_analysis_work.txt | 15 +++++++++++++++ 2 files changed, 16 insertions(+), 1 deletion(-) create mode 100644 openupgrade_scripts/scripts/event_booth_sale/16.0.1.1/upgrade_analysis_work.txt diff --git a/docsource/modules150-160.rst b/docsource/modules150-160.rst index eb6fe500c863..70b555fb66a7 100644 --- a/docsource/modules150-160.rst +++ b/docsource/modules150-160.rst @@ -134,7 +134,7 @@ Module coverage 15.0 -> 16.0 +-------------------------------------------------+----------------------+-------------------------------------------------+ | event_booth | Nothing to do | | +-------------------------------------------------+----------------------+-------------------------------------------------+ -| event_booth_sale | | | +| event_booth_sale | Nothing to do | | +-------------------------------------------------+----------------------+-------------------------------------------------+ | event_crm | Nothing to do | | +-------------------------------------------------+----------------------+-------------------------------------------------+ diff --git a/openupgrade_scripts/scripts/event_booth_sale/16.0.1.1/upgrade_analysis_work.txt b/openupgrade_scripts/scripts/event_booth_sale/16.0.1.1/upgrade_analysis_work.txt new file mode 100644 index 000000000000..06b2d6b65338 --- /dev/null +++ b/openupgrade_scripts/scripts/event_booth_sale/16.0.1.1/upgrade_analysis_work.txt @@ -0,0 +1,15 @@ +---Models in module 'event_booth_sale'--- +---Fields in module 'event_booth_sale'--- +event_booth_sale / event.booth / price (float) : is now stored +event_booth_sale / event.type.booth / price (float) : is now stored +event_booth_sale / product.template / detailed_type (False) : selection_keys is now '['consu', 'course', 'event', 'event_booth', 'product', 'service']' ('['consu', 'event', 'event_booth', 'gift', 'product', 'service']') + +# NOTHING TO DO + +---XML records in module 'event_booth_sale'--- +NEW ir.ui.view: event_booth_sale.event_booth_view_graph +NEW ir.ui.view: event_booth_sale.event_booth_view_pivot +NEW ir.ui.view: event_booth_sale.event_booth_view_tree_from_event +DEL ir.ui.view: event_booth_sale.event_booth_view_tree + +# NOTHING TO DO From 665a3c85c49ad59151337292dc1269864f5c9e64 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miquel=20Ra=C3=AFch?= Date: Fri, 24 Jan 2025 12:25:41 +0100 Subject: [PATCH 2/2] [OU-IMP] event_booth_sale: finish migration --- docsource/modules150-160.rst | 2 +- .../16.0.1.1/post-migration.py | 28 +++++++++++++++++++ .../16.0.1.1/upgrade_analysis_work.txt | 4 +-- 3 files changed, 31 insertions(+), 3 deletions(-) create mode 100644 openupgrade_scripts/scripts/event_booth_sale/16.0.1.1/post-migration.py diff --git a/docsource/modules150-160.rst b/docsource/modules150-160.rst index 70b555fb66a7..c8ec7bd8c2af 100644 --- a/docsource/modules150-160.rst +++ b/docsource/modules150-160.rst @@ -134,7 +134,7 @@ Module coverage 15.0 -> 16.0 +-------------------------------------------------+----------------------+-------------------------------------------------+ | event_booth | Nothing to do | | +-------------------------------------------------+----------------------+-------------------------------------------------+ -| event_booth_sale | Nothing to do | | +| event_booth_sale | Done | | +-------------------------------------------------+----------------------+-------------------------------------------------+ | event_crm | Nothing to do | | +-------------------------------------------------+----------------------+-------------------------------------------------+ diff --git a/openupgrade_scripts/scripts/event_booth_sale/16.0.1.1/post-migration.py b/openupgrade_scripts/scripts/event_booth_sale/16.0.1.1/post-migration.py new file mode 100644 index 000000000000..adcac39b1403 --- /dev/null +++ b/openupgrade_scripts/scripts/event_booth_sale/16.0.1.1/post-migration.py @@ -0,0 +1,28 @@ +# Copyright 2025 ForgeFlow S.L. (http://www.forgeflow.com) +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + +from openupgradelib import openupgrade + + +def fill_related_stored_fields(env): + openupgrade.logged_query( + env.cr, + """UPDATE event_booth eb + SET price = ebc.price + FROM event_booth_category ebc + WHERE eb.booth_category_id = ebc.id + """, + ) + openupgrade.logged_query( + env.cr, + """UPDATE event_type_booth etb + SET price = ebc.price + FROM event_booth_category ebc + WHERE etb.booth_category_id = ebc.id + """, + ) + + +@openupgrade.migrate() +def migrate(env, version): + fill_related_stored_fields(env) diff --git a/openupgrade_scripts/scripts/event_booth_sale/16.0.1.1/upgrade_analysis_work.txt b/openupgrade_scripts/scripts/event_booth_sale/16.0.1.1/upgrade_analysis_work.txt index 06b2d6b65338..9a0254d3d19d 100644 --- a/openupgrade_scripts/scripts/event_booth_sale/16.0.1.1/upgrade_analysis_work.txt +++ b/openupgrade_scripts/scripts/event_booth_sale/16.0.1.1/upgrade_analysis_work.txt @@ -2,8 +2,9 @@ ---Fields in module 'event_booth_sale'--- event_booth_sale / event.booth / price (float) : is now stored event_booth_sale / event.type.booth / price (float) : is now stored -event_booth_sale / product.template / detailed_type (False) : selection_keys is now '['consu', 'course', 'event', 'event_booth', 'product', 'service']' ('['consu', 'event', 'event_booth', 'gift', 'product', 'service']') +# DONE: post-migration: fill related stored fields +event_booth_sale / product.template / detailed_type (False) : selection_keys is now '['consu', 'course', 'event', 'event_booth', 'product', 'service']' ('['consu', 'event', 'event_booth', 'gift', 'product', 'service']') # NOTHING TO DO ---XML records in module 'event_booth_sale'--- @@ -11,5 +12,4 @@ NEW ir.ui.view: event_booth_sale.event_booth_view_graph NEW ir.ui.view: event_booth_sale.event_booth_view_pivot NEW ir.ui.view: event_booth_sale.event_booth_view_tree_from_event DEL ir.ui.view: event_booth_sale.event_booth_view_tree - # NOTHING TO DO