Skip to content

Commit fadecc7

Browse files
committed
Merge PR #4838 into 17.0
Signed-off-by MiquelRForgeFlow
2 parents 954f278 + ac89f7b commit fadecc7

File tree

4 files changed

+153
-1
lines changed

4 files changed

+153
-1
lines changed

docsource/modules160-170.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1132,7 +1132,7 @@ Module coverage 16.0 -> 17.0
11321132
+---------------------------------------------------+----------------------+-------------------------------------------------+
11331133
| website_sale_wishlist | | |
11341134
+---------------------------------------------------+----------------------+-------------------------------------------------+
1135-
| website_slides | | |
1135+
| website_slides | Done | |
11361136
+---------------------------------------------------+----------------------+-------------------------------------------------+
11371137
| website_slides_forum | | |
11381138
+---------------------------------------------------+----------------------+-------------------------------------------------+
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# Copyright 2024 Viindoo Technology Joint Stock Company (Viindoo)
2+
# Copyright 2025 ForgeFlow S.L. (https://www.forgeflow.com)
3+
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
4+
5+
from openupgradelib import openupgrade
6+
7+
8+
@openupgrade.migrate()
9+
def migrate(env, version):
10+
openupgrade.load_data(env, "website_slides", "17.0.2.7/noupdate_changes.xml")
11+
openupgrade.delete_record_translations(
12+
env.cr,
13+
"website_slides",
14+
["mail_notification_channel_invite", "mail_template_slide_channel_invite"],
15+
)
16+
openupgrade.delete_records_safely_by_xml_id(
17+
env,
18+
[
19+
"website_slides.rule_slide_channel_not_website",
20+
"website_slides.rule_slide_slide_not_website",
21+
],
22+
)
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
# Copyright 2025 ForgeFlow S.L. (https://www.forgeflow.com)
2+
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
3+
from openupgradelib import openupgrade
4+
5+
6+
def precreate_slide_channel_partner_active(env):
7+
openupgrade.logged_query(
8+
env.cr,
9+
"""
10+
ALTER TABLE slide_channel_partner ADD COLUMN active boolean DEFAULT true
11+
""",
12+
)
13+
openupgrade.logged_query(
14+
env.cr,
15+
"""
16+
ALTER TABLE slide_channel_partner ALTER COLUMN active DROP DEFAULT
17+
""",
18+
)
19+
20+
21+
def fill_slide_channel_partner_member_status(env):
22+
openupgrade.logged_query(
23+
env.cr,
24+
"""
25+
ALTER TABLE slide_channel_partner ADD COLUMN IF NOT EXISTS member_status varchar
26+
""",
27+
)
28+
openupgrade.logged_query(
29+
env.cr,
30+
"""
31+
UPDATE slide_channel_partner
32+
SET member_status = CASE WHEN completed OR completion = 100 THEN 'completed'
33+
CASE WHEN completion = 0 OR completion IS NULL THEN 'joined'
34+
ELSE 'ongoing' END
35+
""",
36+
)
37+
38+
39+
@openupgrade.migrate()
40+
def migrate(env, version):
41+
precreate_slide_channel_partner_active(env)
42+
fill_slide_channel_partner_member_status(env)
Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
1+
---Fields in module 'website_slides'---
2+
website_slides / res.partner / slide_channel_ids (many2many) : not stored anymore
3+
website_slides / res.partner / slide_channel_ids (many2many) : now a function
4+
website_slides / res.partner / slide_channel_ids (many2many) : table is now 'False' ('slide_channel_partner')
5+
# NOTHING TO DO
6+
7+
website_slides / slide.answer / _order : _order is now 'question_id, sequence, id' ('question_id, sequence')
8+
website_slides / slide.channel / activity_user_id (many2one) : not related anymore
9+
website_slides / slide.channel / activity_user_id (many2one) : now a function
10+
website_slides / slide.channel / channel_partner_all_ids (one2many): NEW relation: slide.channel.partner
11+
website_slides / slide.channel / karma_gen_slide_vote (integer): DEL
12+
website_slides / slide.channel / message_main_attachment_id (many2one): DEL relation: ir.attachment
13+
website_slides / slide.channel / partner_ids (many2many) : not stored anymore
14+
website_slides / slide.channel / partner_ids (many2many) : now a function
15+
website_slides / slide.channel / partner_ids (many2many) : table is now 'False' ('slide_channel_partner')
16+
website_slides / slide.channel / prerequisite_channel_ids (many2many): NEW relation: slide.channel
17+
website_slides / slide.channel / prerequisite_of_channel_ids (many2many): NEW relation: slide.channel
18+
website_slides / slide.channel / visibility (selection) : selection_keys is now '['connected', 'members', 'public']' ('['members', 'public']')
19+
# NOTHING TO DO
20+
21+
website_slides / slide.channel.partner / active (boolean) : NEW hasdefault: default
22+
# DONE: pre-migration: precreate column and fill with True
23+
24+
website_slides / slide.channel.partner / completed (boolean) : DEL
25+
website_slides / slide.channel.partner / member_status (selection) : NEW required, selection_keys: ['completed', 'invited', 'joined', 'ongoing']
26+
# DONE: pre-migration: fill using completion field
27+
28+
website_slides / slide.channel.partner / last_invitation_date (datetime): NEW
29+
# NOTHING TO DO: new feature used with new 'invited' option of member_status
30+
31+
website_slides / slide.slide / message_main_attachment_id (many2one): DEL relation: ir.attachment
32+
website_slides / slide.slide / rating_ids (one2many) : NEW relation: rating.rating
33+
# NOTHING TO DO
34+
35+
---XML records in module 'website_slides'---
36+
NEW ir.model.access: website_slides.access_slide_channel_employee
37+
NEW ir.model.access: website_slides.access_slide_channel_portal
38+
NEW ir.model.access: website_slides.access_slide_channel_public
39+
NEW ir.model.access: website_slides.access_slide_channel_tag_employee
40+
NEW ir.model.access: website_slides.access_slide_channel_tag_group_employee
41+
NEW ir.model.access: website_slides.access_slide_channel_tag_group_portal
42+
NEW ir.model.access: website_slides.access_slide_channel_tag_group_public
43+
NEW ir.model.access: website_slides.access_slide_channel_tag_portal
44+
NEW ir.model.access: website_slides.access_slide_channel_tag_public
45+
NEW ir.model.access: website_slides.access_slide_embed_portal
46+
NEW ir.model.access: website_slides.access_slide_embed_public
47+
NEW ir.model.access: website_slides.access_slide_question_employee
48+
NEW ir.model.access: website_slides.access_slide_question_portal
49+
NEW ir.model.access: website_slides.access_slide_question_public
50+
NEW ir.model.access: website_slides.access_slide_slide_employee
51+
NEW ir.model.access: website_slides.access_slide_slide_portal
52+
NEW ir.model.access: website_slides.access_slide_slide_public
53+
NEW ir.model.access: website_slides.access_slide_tag_employee
54+
NEW ir.model.access: website_slides.access_slide_tag_portal
55+
NEW ir.model.access: website_slides.access_slide_tag_public
56+
DEL ir.model.access: website_slides.access_slide_channel_all
57+
DEL ir.model.access: website_slides.access_slide_channel_tag_all
58+
DEL ir.model.access: website_slides.access_slide_channel_tag_group_all
59+
DEL ir.model.access: website_slides.access_slide_embed_all
60+
DEL ir.model.access: website_slides.access_slide_question_all
61+
DEL ir.model.access: website_slides.access_slide_slide_all
62+
DEL ir.model.access: website_slides.access_slide_tag_all
63+
# NOTHING TO DO
64+
65+
NEW ir.model.constraint: website_slides.constraint_slide_channel_check_enroll
66+
# NOTHING TO DO
67+
68+
NEW ir.rule: website_slides.rule_slide_channel_visibility_public_user (noupdate)
69+
NEW ir.rule: website_slides.rule_slide_channel_visibility_signed_in_user (noupdate)
70+
NEW ir.rule: website_slides.rule_slide_slide_public_user (noupdate)
71+
NEW ir.rule: website_slides.rule_slide_slide_signed_in_user (noupdate)
72+
# NOTHING TO DO
73+
74+
DEL ir.rule: website_slides.rule_slide_channel_not_website (noupdate)
75+
DEL ir.rule: website_slides.rule_slide_slide_not_website (noupdate)
76+
# DONE: post-migration: safely delete
77+
78+
NEW ir.ui.view: website_slides.course_slides_list_placeholder
79+
NEW ir.ui.view: website_slides.gamification_karma_tracking_view_search
80+
NEW ir.ui.view: website_slides.profile_access_denied
81+
NEW ir.ui.view: website_slides.slide_channel_partner_view_graph
82+
NEW ir.ui.view: website_slides.slide_channel_partner_view_pivot
83+
DEL ir.ui.view: website_slides.private_profile
84+
DEL ir.ui.view: website_slides.slide_icon
85+
# NOTHING TO DO
86+
87+
NEW mail.template: website_slides.mail_template_slide_channel_enroll (noupdate)
88+
# NOTHING TO DO

0 commit comments

Comments
 (0)