-
-
Notifications
You must be signed in to change notification settings - Fork 784
[18.0][OU-ADD] web_tour #4744
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
Merged
Merged
[18.0][OU-ADD] web_tour #4744
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
21 changes: 21 additions & 0 deletions
21
openupgrade_scripts/scripts/web_tour/18.0.1.0/end-migration.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,21 @@ | ||
| from openupgradelib import openupgrade | ||
|
|
||
|
|
||
| @openupgrade.migrate() | ||
| def migrate(env, version=None): | ||
| """ | ||
| Set consumed tours from legacy table after migration | ||
| """ | ||
| openupgrade.logged_query( | ||
| env.cr, | ||
| f""" | ||
| INSERT INTO res_users_web_tour_tour_rel | ||
| (res_users_id, web_tour_tour_id) | ||
| SELECT legacy_table.user_id, web_tour_tour.id | ||
| FROM | ||
| {openupgrade.get_legacy_name('web_tour_tour')} legacy_table, | ||
| web_tour_tour | ||
| WHERE web_tour_tour.name=legacy_table.name | ||
| ON CONFLICT DO NOTHING | ||
| """, | ||
| ) | ||
17 changes: 17 additions & 0 deletions
17
openupgrade_scripts/scripts/web_tour/18.0.1.0/pre-migration.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,17 @@ | ||
| from openupgradelib import openupgrade | ||
|
|
||
|
|
||
| @openupgrade.migrate() | ||
| def migrate(env, version=None): | ||
| """ | ||
| web_tour.tour used to be just a marker which tour has been run for which user, | ||
| with a new record for every user who finished the tour. | ||
| In v18 tours are unique by name and have a many2many field for recording which | ||
| users have completed it. | ||
| Move the v17 table out of the way so that we can set tours as consumed in | ||
| end-migration (matched by tour name, if a tour name changes from v17 to v18, | ||
| the migration script will have to rename it in the legacy table - no core module | ||
| does this) | ||
| """ | ||
| openupgrade.remove_tables_fks(env.cr, ["web_tour_tour"]) | ||
| openupgrade.rename_tables(env.cr, [("web_tour_tour", None)]) |
42 changes: 42 additions & 0 deletions
42
openupgrade_scripts/scripts/web_tour/18.0.1.0/upgrade_analysis_work.txt
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,42 @@ | ||
| ---Models in module 'web_tour'--- | ||
| new model web_tour.tour.step | ||
| ---Fields in module 'web_tour'--- | ||
| web_tour / res.users / tour_enabled (boolean) : NEW hasdefault: compute | ||
| web_tour / web_tour.tour / _order : _order is now 'sequence, name, id' ('id') | ||
| web_tour / web_tour.tour / custom (boolean) : NEW | ||
| web_tour / web_tour.tour / rainbow_man_message (html) : NEW hasdefault: default | ||
| web_tour / web_tour.tour / sequence (integer) : NEW hasdefault: default | ||
| web_tour / web_tour.tour / step_ids (one2many) : NEW relation: web_tour.tour.step | ||
| web_tour / web_tour.tour / url (char) : NEW hasdefault: default | ||
|
|
||
| NOTHING TO DO | ||
|
|
||
| web_tour / web_tour.tour / user_consumed_ids (many2many) : NEW relation: res.users | ||
| web_tour / web_tour.tour / user_id (many2one) : DEL relation: res.users | ||
|
|
||
| DONE: move old table aside in pre-migration, set user_consumed_ids from this table and delete it in end migration | ||
|
|
||
| web_tour / web_tour.tour.step / content (char) : NEW | ||
| web_tour / web_tour.tour.step / run (char) : NEW | ||
| web_tour / web_tour.tour.step / sequence (integer) : NEW | ||
| web_tour / web_tour.tour.step / tour_id (many2one) : NEW relation: web_tour.tour, required | ||
| web_tour / web_tour.tour.step / trigger (char) : NEW required | ||
| ---XML records in module 'web_tour'--- | ||
| NEW ir.actions.act_window: web_tour.tour_action | ||
| DEL ir.actions.act_window: web_tour.edit_tour_action | ||
| NEW ir.actions.server: web_tour.tour_export_js_action | ||
| NEW ir.model.access: web_tour.access_web_tour_tour_readonly | ||
| NEW ir.model.access: web_tour.access_web_tour_tour_step_admin | ||
| NEW ir.model.access: web_tour.access_web_tour_tour_step_readonly | ||
| DEL ir.model.access: web_tour.access_web_tour_tour | ||
| NEW ir.model.constraint: web_tour.constraint_web_tour_tour_uniq_name | ||
| DEL ir.rule: web_tour.own_tours | ||
| NEW ir.ui.view: web_tour.res_users_view_form | ||
| NEW ir.ui.view: web_tour.tour_form | ||
| NEW ir.ui.view: web_tour.tour_list | ||
| NEW ir.ui.view: web_tour.tour_search | ||
| DEL ir.ui.view: web_tour.edit_tour_form | ||
| DEL ir.ui.view: web_tour.edit_tour_list | ||
| DEL ir.ui.view: web_tour.edit_tour_search | ||
|
|
||
| NOTHING TO DO |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.