Skip to content
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

[17.0][OU-ADD] gamification: Migration to 17.0 #4625

Open
wants to merge 1 commit into
base: 17.0
Choose a base branch
from
Open
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/modules160-170.rst
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ Module coverage 16.0 -> 17.0
+---------------------------------------------------+----------------------+-------------------------------------------------+
| fleet | | |
+---------------------------------------------------+----------------------+-------------------------------------------------+
| gamification | | |
| gamification | Done | |
+---------------------------------------------------+----------------------+-------------------------------------------------+
| gamification_sale_crm | | |
+---------------------------------------------------+----------------------+-------------------------------------------------+
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Copyright 2024 Viindoo Technology Joint Stock Company (Viindoo)
# 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, "gamification", "17.0.1.0/noupdate_changes.xml")
16 changes: 16 additions & 0 deletions openupgrade_scripts/scripts/gamification/17.0.1.0/pre-migration.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Copyright 2024 Tecnativa - Pedro M. Baeza
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).

from openupgradelib import openupgrade

_xmlid_renames = [
(
"gamification.ir_cron_consolidate_last_month",
"gamification.ir_cron_consolidate",
)
]


@openupgrade.migrate()
def migrate(env, version):
openupgrade.rename_xmlids(env.cr, _xmlid_renames)
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
---Models in module 'gamification'---
---Fields in module 'gamification'---
gamification / gamification.badge / message_main_attachment_id (many2one): DEL relation: ir.attachment
gamification / gamification.challenge / message_main_attachment_id (many2one): DEL relation: ir.attachment
gamification / gamification.challenge / report_message_group_id (many2one): relation is now 'discuss.channel' ('mail.channel') [nothing to do]
# NOTHING TO DO: feature removed

gamification / gamification.karma.tracking / _order : _order is now 'tracking_date desc, id desc' ('tracking_date DESC')
gamification / gamification.karma.tracking / gain (integer) : NEW hasdefault: compute
gamification / gamification.karma.tracking / origin_ref (reference) : NEW hasdefault: default
gamification / gamification.karma.tracking / origin_ref_model_name (selection): NEW selection_keys: function, isfunction: function, stored
gamification / gamification.karma.tracking / reason (text) : NEW hasdefault: default
# NOTHING TO DO: new feature

gamification / gamification.karma.tracking / tracking_date (date) : type is now 'datetime' ('date')
# NOTHING TO DO: values were already encoded in standard datetime format in psql

---XML records in module 'gamification'---
NEW gamification.karma.tracking: gamification.karma_tracking_user_admin (noupdate)
NEW gamification.karma.tracking: gamification.karma_tracking_user_root (noupdate)
# NOTHING TO DO: New noupdate="1" records

NEW ir.cron: gamification.ir_cron_consolidate (noupdate)
DEL ir.cron: gamification.ir_cron_consolidate_last_month (noupdate)
# DONE: pre-migration: XML-ID renamed

NEW ir.model.access: gamification.gamification_karma_rank_access_employee
NEW ir.model.access: gamification.gamification_karma_rank_access_portal
NEW ir.model.access: gamification.gamification_karma_rank_access_public
DEL ir.model.access: gamification.gamification_karma_rank_access_all
# NOTHING TO DO: new feature
Loading