diff --git a/openupgrade_scripts/scripts/web_tour/18.0.1.0/end-migration.py b/openupgrade_scripts/scripts/web_tour/18.0.1.0/end-migration.py index e2f42aa290ce..d60f56be0fa1 100644 --- a/openupgrade_scripts/scripts/web_tour/18.0.1.0/end-migration.py +++ b/openupgrade_scripts/scripts/web_tour/18.0.1.0/end-migration.py @@ -4,7 +4,8 @@ @openupgrade.migrate() def migrate(env, version=None): """ - Set consumed tours from legacy table after migration + Set consumed tours from legacy table after migration and + remove obsolete security rules. """ openupgrade.logged_query( env.cr, @@ -19,3 +20,14 @@ def migrate(env, version=None): ON CONFLICT DO NOTHING """, ) + + openupgrade.logged_query( + env.cr, + """ + DELETE FROM ir_rule + WHERE model_id = ( + SELECT id FROM ir_model WHERE model = 'web_tour.tour' + ) + AND domain_force LIKE '%user_id%'; + """, + )