Skip to content

Commit

Permalink
[OU-FIX] website_event_track: handle properly exhibitors
Browse files Browse the repository at this point in the history
  • Loading branch information
pedrobaeza committed Jul 5, 2023
1 parent 5260a62 commit fac44d2
Showing 1 changed file with 8 additions and 25 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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' "
Expand Down Expand Up @@ -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:
Expand Down

0 comments on commit fac44d2

Please sign in to comment.