Skip to content
Merged
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion docsource/modules180-190.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1174,7 +1174,7 @@ Module coverage 18.0 -> 19.0
+---------------------------------------------------+----------------------+-------------------------------------------------+
| website_event_track_quiz | |No DB layout changes. |
+---------------------------------------------------+----------------------+-------------------------------------------------+
| website_forum | | |
| website_forum |Done | |
+---------------------------------------------------+----------------------+-------------------------------------------------+
| website_google_map |Nothing to do | |
+---------------------------------------------------+----------------------+-------------------------------------------------+
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# 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_forum", "19.0.1.2/noupdate_changes.xml")
openupgrade.delete_record_translations(
env.cr,
"website_forum",
[
"forum_post_template_new_answer",
"forum_post_template_new_question",
"forum_post_template_validation",
],
["arch_db"],
)
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# 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 [
("forum.forum", "forum_forum"),
("forum.post", "forum_post"),
("forum.tag", "forum_tag"),
]:
_precompute_is_seo_optimized(env, model_name, table_name)
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
---Models in module 'website_forum'---
# NOTHING TO DO

---Fields in module 'website_forum'---
website_forum / forum.forum / teaser (text) : DEL
# NOTHING TO DO

website_forum / forum.forum / is_seo_optimized (boolean) : is now stored
website_forum / forum.post / is_seo_optimized (boolean) : is now stored
website_forum / forum.tag / 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_forum'---
DEL ir.model.access: website_forum.access_forum_post_vote_public
NEW ir.rule: website_forum.website_forum_post_vote_all (noupdate)
NEW ir.rule: website_forum.website_forum_post_vote_own (noupdate)
DEL ir.ui.view: website_forum.forum_searchbar_input_snippet_options
DEL ir.ui.view: website_forum.snippet_options
DEL ir.ui.view: website_forum.user_profile_sub_nav
DEL ir.ui.view: website_forum.view_users_form_forum
# NOTHING TO DO: noupdate changes are handled automatically.
Loading