diff --git a/docsource/modules160-170.rst b/docsource/modules160-170.rst index d94013675ef5..706c4f1949d3 100644 --- a/docsource/modules160-170.rst +++ b/docsource/modules160-170.rst @@ -1132,7 +1132,7 @@ Module coverage 16.0 -> 17.0 +---------------------------------------------------+----------------------+-------------------------------------------------+ | website_sale_wishlist | | | +---------------------------------------------------+----------------------+-------------------------------------------------+ -| website_slides | | | +| website_slides | Done | | +---------------------------------------------------+----------------------+-------------------------------------------------+ | website_slides_forum | | | +---------------------------------------------------+----------------------+-------------------------------------------------+ diff --git a/openupgrade_scripts/scripts/website_slides/17.0.2.7/post-migration.py b/openupgrade_scripts/scripts/website_slides/17.0.2.7/post-migration.py new file mode 100644 index 000000000000..313d44056499 --- /dev/null +++ b/openupgrade_scripts/scripts/website_slides/17.0.2.7/post-migration.py @@ -0,0 +1,22 @@ +# Copyright 2024 Viindoo Technology Joint Stock Company (Viindoo) +# Copyright 2025 ForgeFlow S.L. (https://www.forgeflow.com) +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). + +from openupgradelib import openupgrade + + +@openupgrade.migrate() +def migrate(env, version): + openupgrade.load_data(env, "website_slides", "17.0.2.7/noupdate_changes.xml") + openupgrade.delete_record_translations( + env.cr, + "website_slides", + ["mail_notification_channel_invite", "mail_template_slide_channel_invite"], + ) + openupgrade.delete_records_safely_by_xml_id( + env, + [ + "website_slides.rule_slide_channel_not_website", + "website_slides.rule_slide_slide_not_website", + ], + ) diff --git a/openupgrade_scripts/scripts/website_slides/17.0.2.7/pre-migration.py b/openupgrade_scripts/scripts/website_slides/17.0.2.7/pre-migration.py new file mode 100644 index 000000000000..5a3d2ffcce7d --- /dev/null +++ b/openupgrade_scripts/scripts/website_slides/17.0.2.7/pre-migration.py @@ -0,0 +1,42 @@ +# Copyright 2025 ForgeFlow S.L. (https://www.forgeflow.com) +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). +from openupgradelib import openupgrade + + +def precreate_slide_channel_partner_active(env): + openupgrade.logged_query( + env.cr, + """ + ALTER TABLE slide_channel_partner ADD COLUMN active boolean DEFAULT true + """, + ) + openupgrade.logged_query( + env.cr, + """ + ALTER TABLE slide_channel_partner ALTER COLUMN active DROP DEFAULT + """, + ) + + +def fill_slide_channel_partner_member_status(env): + openupgrade.logged_query( + env.cr, + """ + ALTER TABLE slide_channel_partner ADD COLUMN IF NOT EXISTS member_status varchar + """, + ) + openupgrade.logged_query( + env.cr, + """ + UPDATE slide_channel_partner + SET member_status = CASE WHEN completed OR completion = 100 THEN 'completed' + WHEN completion = 0 OR completion IS NULL THEN 'joined' + ELSE 'ongoing' END + """, + ) + + +@openupgrade.migrate() +def migrate(env, version): + precreate_slide_channel_partner_active(env) + fill_slide_channel_partner_member_status(env) diff --git a/openupgrade_scripts/scripts/website_slides/17.0.2.7/upgrade_analysis_work.txt b/openupgrade_scripts/scripts/website_slides/17.0.2.7/upgrade_analysis_work.txt new file mode 100644 index 000000000000..19876a8c9b20 --- /dev/null +++ b/openupgrade_scripts/scripts/website_slides/17.0.2.7/upgrade_analysis_work.txt @@ -0,0 +1,88 @@ +---Fields in module 'website_slides'--- +website_slides / res.partner / slide_channel_ids (many2many) : not stored anymore +website_slides / res.partner / slide_channel_ids (many2many) : now a function +website_slides / res.partner / slide_channel_ids (many2many) : table is now 'False' ('slide_channel_partner') +# NOTHING TO DO + +website_slides / slide.answer / _order : _order is now 'question_id, sequence, id' ('question_id, sequence') +website_slides / slide.channel / activity_user_id (many2one) : not related anymore +website_slides / slide.channel / activity_user_id (many2one) : now a function +website_slides / slide.channel / channel_partner_all_ids (one2many): NEW relation: slide.channel.partner +website_slides / slide.channel / karma_gen_slide_vote (integer): DEL +website_slides / slide.channel / message_main_attachment_id (many2one): DEL relation: ir.attachment +website_slides / slide.channel / partner_ids (many2many) : not stored anymore +website_slides / slide.channel / partner_ids (many2many) : now a function +website_slides / slide.channel / partner_ids (many2many) : table is now 'False' ('slide_channel_partner') +website_slides / slide.channel / prerequisite_channel_ids (many2many): NEW relation: slide.channel +website_slides / slide.channel / prerequisite_of_channel_ids (many2many): NEW relation: slide.channel +website_slides / slide.channel / visibility (selection) : selection_keys is now '['connected', 'members', 'public']' ('['members', 'public']') +# NOTHING TO DO + +website_slides / slide.channel.partner / active (boolean) : NEW hasdefault: default +# DONE: pre-migration: precreate column and fill with True + +website_slides / slide.channel.partner / completed (boolean) : DEL +website_slides / slide.channel.partner / member_status (selection) : NEW required, selection_keys: ['completed', 'invited', 'joined', 'ongoing'] +# DONE: pre-migration: fill using completion field + +website_slides / slide.channel.partner / last_invitation_date (datetime): NEW +# NOTHING TO DO: new feature used with new 'invited' option of member_status + +website_slides / slide.slide / message_main_attachment_id (many2one): DEL relation: ir.attachment +website_slides / slide.slide / rating_ids (one2many) : NEW relation: rating.rating +# NOTHING TO DO + +---XML records in module 'website_slides'--- +NEW ir.model.access: website_slides.access_slide_channel_employee +NEW ir.model.access: website_slides.access_slide_channel_portal +NEW ir.model.access: website_slides.access_slide_channel_public +NEW ir.model.access: website_slides.access_slide_channel_tag_employee +NEW ir.model.access: website_slides.access_slide_channel_tag_group_employee +NEW ir.model.access: website_slides.access_slide_channel_tag_group_portal +NEW ir.model.access: website_slides.access_slide_channel_tag_group_public +NEW ir.model.access: website_slides.access_slide_channel_tag_portal +NEW ir.model.access: website_slides.access_slide_channel_tag_public +NEW ir.model.access: website_slides.access_slide_embed_portal +NEW ir.model.access: website_slides.access_slide_embed_public +NEW ir.model.access: website_slides.access_slide_question_employee +NEW ir.model.access: website_slides.access_slide_question_portal +NEW ir.model.access: website_slides.access_slide_question_public +NEW ir.model.access: website_slides.access_slide_slide_employee +NEW ir.model.access: website_slides.access_slide_slide_portal +NEW ir.model.access: website_slides.access_slide_slide_public +NEW ir.model.access: website_slides.access_slide_tag_employee +NEW ir.model.access: website_slides.access_slide_tag_portal +NEW ir.model.access: website_slides.access_slide_tag_public +DEL ir.model.access: website_slides.access_slide_channel_all +DEL ir.model.access: website_slides.access_slide_channel_tag_all +DEL ir.model.access: website_slides.access_slide_channel_tag_group_all +DEL ir.model.access: website_slides.access_slide_embed_all +DEL ir.model.access: website_slides.access_slide_question_all +DEL ir.model.access: website_slides.access_slide_slide_all +DEL ir.model.access: website_slides.access_slide_tag_all +# NOTHING TO DO + +NEW ir.model.constraint: website_slides.constraint_slide_channel_check_enroll +# NOTHING TO DO + +NEW ir.rule: website_slides.rule_slide_channel_visibility_public_user (noupdate) +NEW ir.rule: website_slides.rule_slide_channel_visibility_signed_in_user (noupdate) +NEW ir.rule: website_slides.rule_slide_slide_public_user (noupdate) +NEW ir.rule: website_slides.rule_slide_slide_signed_in_user (noupdate) +# NOTHING TO DO + +DEL ir.rule: website_slides.rule_slide_channel_not_website (noupdate) +DEL ir.rule: website_slides.rule_slide_slide_not_website (noupdate) +# DONE: post-migration: safely delete + +NEW ir.ui.view: website_slides.course_slides_list_placeholder +NEW ir.ui.view: website_slides.gamification_karma_tracking_view_search +NEW ir.ui.view: website_slides.profile_access_denied +NEW ir.ui.view: website_slides.slide_channel_partner_view_graph +NEW ir.ui.view: website_slides.slide_channel_partner_view_pivot +DEL ir.ui.view: website_slides.private_profile +DEL ir.ui.view: website_slides.slide_icon +# NOTHING TO DO + +NEW mail.template: website_slides.mail_template_slide_channel_enroll (noupdate) +# NOTHING TO DO