-
-
Notifications
You must be signed in to change notification settings - Fork 821
[19.0][OU-ADD] website_slides: Migration scripts #5783
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
+101
−1
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
41 changes: 41 additions & 0 deletions
41
openupgrade_scripts/scripts/website_slides/19.0.2.7/post-migration.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,41 @@ | ||
| # Copyright 2026 Tecnativa - Pilar Vargas | ||
| # License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). | ||
|
|
||
| from openupgradelib import openupgrade | ||
|
|
||
|
|
||
| @openupgrade.migrate() | ||
| def migrate(env, version): | ||
| openupgrade.load_data(env, "website_slides", "19.0.2.7/noupdate_changes.xml") | ||
| openupgrade.delete_records_safely_by_xml_id( | ||
| env, | ||
| ["website_slides.mail_activity_data_access_request"], | ||
| ) | ||
| openupgrade.delete_record_translations( | ||
| env.cr, | ||
| "website_slides", | ||
| ["mail_notification_channel_invite"], | ||
| ["arch_db"], | ||
| ) | ||
| openupgrade.delete_record_translations( | ||
| env.cr, | ||
| "website_slides", | ||
| [ | ||
| "mail_template_channel_completed", | ||
| "mail_template_channel_shared", | ||
| "slide_template_published", | ||
| "slide_template_shared", | ||
| ], | ||
| ["body_html"], | ||
| ) | ||
| openupgrade.delete_record_translations( | ||
| env.cr, | ||
| "website_slides", | ||
| [ | ||
| "rule_slide_channel_visibility_public_user", | ||
| "rule_slide_channel_visibility_signed_in_user", | ||
| "rule_slide_slide_public_user", | ||
| "rule_slide_slide_signed_in_user", | ||
| ], | ||
| ["name"], | ||
| ) |
30 changes: 30 additions & 0 deletions
30
openupgrade_scripts/scripts/website_slides/19.0.2.7/pre-migration.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,30 @@ | ||
| # Copyright 2026 Tecnativa - Pilar Vargas | ||
| # License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). | ||
|
|
||
| from openupgradelib import openupgrade | ||
|
|
||
|
|
||
| def _precompute_is_seo_optimized(env, model_name, table_name): | ||
| openupgrade.add_columns( | ||
| env, | ||
| [(model_name, "is_seo_optimized", "boolean", False, table_name)], | ||
| ) | ||
| openupgrade.logged_query( | ||
| env.cr, | ||
| f""" | ||
| UPDATE {table_name} | ||
| SET is_seo_optimized = TRUE | ||
| WHERE website_meta_title IS NOT NULL | ||
| AND website_meta_description IS NOT NULL | ||
| AND website_meta_keywords IS NOT NULL | ||
| """, | ||
| ) | ||
|
|
||
|
|
||
| @openupgrade.migrate() | ||
| def migrate(env, version): | ||
| for model_name, table_name in [ | ||
| ("slide.channel", "slide_channel"), | ||
| ("slide.slide", "slide_slide"), | ||
| ]: | ||
| _precompute_is_seo_optimized(env, model_name, table_name) |
29 changes: 29 additions & 0 deletions
29
openupgrade_scripts/scripts/website_slides/19.0.2.7/upgrade_analysis_work.txt
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,29 @@ | ||
| ---Models in module 'website_slides'--- | ||
| # NOTHING TO DO | ||
|
|
||
| ---Fields in module 'website_slides'--- | ||
| website_slides / mail.activity / request_partner_id (many2one) : previously in module mail | ||
| website_slides / slide.channel / visibility (selection) : selection_keys added: [link] (most likely nothing to do) | ||
| # NOTHING TO DO: field ownership/selection changes do not require data migration | ||
|
|
||
| website_slides / slide.channel / is_seo_optimized (boolean) : is now stored | ||
| website_slides / slide.slide / is_seo_optimized (boolean) : is now stored | ||
| # DONE: pre-migration precomputes stored is_seo_optimized values from existing SEO metadata | ||
|
|
||
| ---XML records in module 'website_slides'--- | ||
| NEW ir.ui.view: website_slides.course_card_information_badge | ||
| NEW ir.ui.view: website_slides.courses_home_side_bar | ||
| NEW ir.ui.view: website_slides.courses_my | ||
| NEW ir.ui.view: website_slides.courses_search_bar | ||
| NEW ir.ui.view: website_slides.courses_search_results | ||
| NEW ir.ui.view: website_slides.courses_search_tags | ||
| NEW ir.ui.view: website_slides.mail_activity_view_form | ||
| DEL ir.ui.view: website_slides.course_card_information_arrow | ||
| DEL ir.ui.view: website_slides.courses_all | ||
| DEL ir.ui.view: website_slides.slide_searchbar_input_snippet_options | ||
| DEL ir.ui.view: website_slides.snippet_options | ||
| NEW res.groups.privilege: website_slides.res_groups_privilege_elearning | ||
| # NOTHING TO DO | ||
|
|
||
| DEL mail.activity.type: website_slides.mail_activity_data_access_request (noupdate) | ||
| # DONE: remove obsolete noupdate mail.activity.type record in post-migration | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.