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

[MIG][15.0]rating: add mig script v15 #3324

Merged
merged 1 commit into from
Jul 27, 2022
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/modules140-150.rst
Original file line number Diff line number Diff line change
Expand Up @@ -594,7 +594,7 @@ Module coverage 14.0 -> 15.0
+-------------------------------------------------+----------------------+-------------------------------------------------+
| purchase_stock | | |
+-------------------------------------------------+----------------------+-------------------------------------------------+
| rating | | |
| rating |Done | |
+-------------------------------------------------+----------------------+-------------------------------------------------+
| repair | | |
+-------------------------------------------------+----------------------+-------------------------------------------------+
Expand Down
17 changes: 17 additions & 0 deletions openupgrade_scripts/scripts/rating/15.0.1.0/post-migration.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
from openupgradelib import openupgrade


@openupgrade.migrate()
def migrate(env, version):
openupgrade.map_values(
env.cr,
openupgrade.get_legacy_name("rating_text"),
"rating_text",
[
("satisfied", "top"),
("not satisfied", "ok"),
("highly_dissatisfied", "ko"),
("no_rating", "none"),
],
table="rating_rating",
)
9 changes: 9 additions & 0 deletions openupgrade_scripts/scripts/rating/15.0.1.0/pre-migration.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
from openupgradelib import openupgrade


@openupgrade.migrate()
def migrate(env, version):
openupgrade.copy_columns(
env.cr,
{"rating_rating": [("rating_text", None, None)]},
)
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---Models in module 'rating'---
---Fields in module 'rating'---
rating / rating.rating / rating_text (selection) : selection_keys is now '['ko', 'none', 'ok', 'top']' ('['highly_dissatisfied', 'no_rating', 'not_satisfied', 'satisfied']')
# DONE: post-migration: mapped value from old keys to new keys
---XML records in module 'rating'---
DEL ir.model.constraint: rating.constraint_rating_rating_rating_range
DEL ir.ui.view: rating.assets_frontend
# NOTHING TO DO