From 5260a62595a2c00b37baa4343bd0ef2cec420330 Mon Sep 17 00:00:00 2001 From: "Pedro M. Baeza" Date: Wed, 5 Jul 2023 08:39:03 +0200 Subject: [PATCH 1/2] [OU-ADD] mass_mailing_event_track: Nothing to do Even no analysis file. TT41016 --- docsource/modules140-150.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docsource/modules140-150.rst b/docsource/modules140-150.rst index b84347a382e3..a303fa106178 100644 --- a/docsource/modules140-150.rst +++ b/docsource/modules140-150.rst @@ -492,7 +492,7 @@ Module coverage 14.0 -> 15.0 +-------------------------------------------------+----------------------+-------------------------------------------------+ | mass_mailing_event_sms | | | +-------------------------------------------------+----------------------+-------------------------------------------------+ -| mass_mailing_event_track | | | +| mass_mailing_event_track | Nothing to do | | +-------------------------------------------------+----------------------+-------------------------------------------------+ | mass_mailing_event_track_sms | | | +-------------------------------------------------+----------------------+-------------------------------------------------+ From fac44d26d44253344c668cf9cc54a5a60e57160a Mon Sep 17 00:00:00 2001 From: "Pedro M. Baeza" Date: Wed, 5 Jul 2023 09:20:31 +0200 Subject: [PATCH 2/2] [OU-FIX] website_event_track: handle properly exhibitors --- .../15.0.1.3/post-migration.py | 33 +++++-------------- 1 file changed, 8 insertions(+), 25 deletions(-) diff --git a/openupgrade_scripts/scripts/website_event_track/15.0.1.3/post-migration.py b/openupgrade_scripts/scripts/website_event_track/15.0.1.3/post-migration.py index 32a8ee19671a..b2ef7fc3d385 100644 --- a/openupgrade_scripts/scripts/website_event_track/15.0.1.3/post-migration.py +++ b/openupgrade_scripts/scripts/website_event_track/15.0.1.3/post-migration.py @@ -8,7 +8,14 @@ def _check_sponsors(env): """If any sponsor found, mark website_event_exhibitor module to be installed, as this is the new host for such model. Also renamed XML-IDs for commodity. """ - if openupgrade.logged_query(env.cr, "SELECT id FROM event_sponsor LIMIT 1"): + env.cr.execute("SELECT id FROM event_sponsor LIMIT 1") + has_sponsor = env.cr.fetchone() + env.cr.execute( + "SELECT state FROM ir_module_module WHERE name='website_event_exhibitor'" + ) + row = env.cr.fetchone() + module_not_installed = row and row[0] == "uninstalled" + if has_sponsor and module_not_installed: openupgrade.logged_query( env.cr, "UPDATE ir_module_module SET state='to install' " @@ -45,30 +52,6 @@ def _check_sponsors(env): "website_event_track.event_sponsor", "website_event_exhibitor.event_sponsor", ), - ( - "website_event_track.event_sponsor_type_view_form", - "website_event_exhibitor.event_sponsor_type_view_form", - ), - ( - "website_event_track.event_sponsor_type_view_tree", - "website_event_exhibitor.event_sponsor_type_view_tree", - ), - ( - "website_event_track.event_sponsor_view_form", - "website_event_exhibitor.event_sponsor_view_form", - ), - ( - "website_event_track.event_sponsor_view_kanban", - "website_event_exhibitor.event_sponsor_view_kanban", - ), - ( - "website_event_track.event_sponsor_view_search", - "website_event_exhibitor.event_sponsor_view_search", - ), - ( - "website_event_track.event_sponsor_view_tree", - "website_event_exhibitor.event_sponsor_view_tree", - ), ], ) else: