Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 13 additions & 1 deletion openupgrade_scripts/scripts/web_tour/18.0.1.0/end-migration.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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%';
""",
)