-
-
Notifications
You must be signed in to change notification settings - Fork 819
[19.0][MIG] event #5748
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
Open
hbrunn
wants to merge
1
commit into
OCA:19.0
Choose a base branch
from
hbrunn:19.0-event
base: 19.0
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
[19.0][MIG] event #5748
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
36 changes: 36 additions & 0 deletions
36
openupgrade_scripts/scripts/event/19.0.1.9/post-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,36 @@ | ||
| # Copyright 2026 Hunki Enterprises BV | ||
| # License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). | ||
|
|
||
| from openupgradelib import openupgrade | ||
|
|
||
|
|
||
| def event_question(env): | ||
| """ | ||
| Convert event_id, event_type_id to their many2many equivalents | ||
| """ | ||
| openupgrade.m2o_to_x2m( | ||
| env.cr, env["event.question"], "event_question", "event_ids", "event_id" | ||
| ) | ||
| openupgrade.m2o_to_x2m( | ||
| env.cr, | ||
| env["event.question"], | ||
| "event_question", | ||
| "event_type_ids", | ||
| "event_type_id", | ||
| ) | ||
|
|
||
|
|
||
| @openupgrade.migrate() | ||
| def migrate(env, version): | ||
| openupgrade.load_data(env, "event", "19.0.1.9/noupdate_changes.xml") | ||
| openupgrade.delete_record_translations( | ||
| env.cr, | ||
| "event", | ||
| [ | ||
| "event_registration_mail_template_badge", | ||
| "event_reminder", | ||
| "event_subscription", | ||
| ], | ||
| ["body_html"], | ||
| ) | ||
| event_question(env) | ||
44 changes: 44 additions & 0 deletions
44
openupgrade_scripts/scripts/event/19.0.1.9/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,44 @@ | ||
| # Copyright 2026 Hunki Enterprises BV | ||
| # License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). | ||
|
|
||
| from openupgradelib import openupgrade | ||
|
|
||
| _copy_columns = { | ||
| "event_event": [ | ||
| ("badge_format", None, None), | ||
| ] | ||
| } | ||
|
|
||
| _added_fields = [ | ||
| ("event_url", "event.event", "event_event", "char", None, "event"), | ||
| ("is_default", "event.question", "event_question", "boolean", None, "event", False), | ||
| ( | ||
| "is_reusable", | ||
| "event.question", | ||
| "event_question", | ||
| "boolean", | ||
| None, | ||
| "event", | ||
| False, | ||
| ), | ||
| ] | ||
|
|
||
|
|
||
| def event_event_badge_format(env): | ||
| """ | ||
| Remap badge printer formats to four_per_sheet | ||
| """ | ||
| openupgrade.map_values( | ||
| env.cr, | ||
| "badge_format", | ||
| "badge_format", | ||
| [("96x134", "four_per_sheet"), ("96x82", "four_per_sheet")], | ||
| table="event_event", | ||
| ) | ||
|
|
||
|
|
||
| @openupgrade.migrate() | ||
| def migrate(env, version): | ||
| openupgrade.copy_columns(env.cr, _copy_columns) | ||
| openupgrade.add_fields(env, _added_fields) | ||
| event_event_badge_format(env) |
126 changes: 126 additions & 0 deletions
126
openupgrade_scripts/scripts/event/19.0.1.9/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,126 @@ | ||
| ---Models in module 'event'--- | ||
| new model event.mail.slot | ||
| new model event.slot | ||
|
|
||
| # NOTHING TO DO: new funcitonality | ||
|
|
||
| ---Fields in module 'event'--- | ||
| event / event.event / badge_format (selection) : selection_keys removed: [96x134, 96x82] | ||
|
|
||
| # DONE: mapped keys to four_per_sheet | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Apart from the same comment of the other PR about letting an empty line in between, this comment misses if it's done in pre or post-migration, as we have done in other PRs. |
||
|
|
||
| event / event.event / event_slot_ids (one2many) : NEW relation: event.slot | ||
|
|
||
| # NOTHING TO DO | ||
|
|
||
| event / event.event / event_url (char) : NEW hasdefault: compute | ||
|
|
||
| # DONE: initialized with null to avoid computation | ||
|
|
||
| event / event.event / general_question_ids (one2many): table is now 'event_event_event_question_rel' ('False') | ||
| event / event.event / general_question_ids (one2many): type is now 'many2many' ('one2many') | ||
|
|
||
| # DONE: converted to many2many | ||
|
|
||
| event / event.event / is_multi_slots (boolean) : NEW | ||
| event / event.event / kanban_state (selection) : selection_keys added: [cancel] (most likely nothing to do) | ||
| event / event.event / kanban_state_label (char) : DEL | ||
|
|
||
| # NOTHING TO DO | ||
|
|
||
| event / event.event / question_ids (one2many) : table is now 'event_event_event_question_rel' ('False') | ||
| event / event.event / question_ids (one2many) : type is now 'many2many' ('one2many') | ||
| event / event.event / specific_question_ids (one2many): table is now 'event_event_event_question_rel' ('False') | ||
| event / event.event / specific_question_ids (one2many): type is now 'many2many' ('one2many') | ||
|
|
||
| # DONE: converted to many2many | ||
|
|
||
| event / event.event.ticket / limit_max_per_order (integer) : NEW hasdefault: default | ||
|
|
||
| # NOTHING TO DO | ||
|
|
||
| event / event.mail / error_datetime (datetime) : NEW | ||
| event / event.mail / interval_type (selection) : selection_keys added: [after_event_start, before_event_end] (most likely nothing to do) | ||
| event / event.mail / mail_slot_ids (one2many) : NEW relation: event.mail.slot | ||
| event / event.mail / mail_state (selection) : selection_keys added: [cancelled, error] (most likely nothing to do) | ||
| event / event.mail.slot / event_slot_id (many2one) : NEW relation: event.slot, required | ||
| event / event.mail.slot / last_registration_id (many2one): NEW relation: event.registration | ||
| event / event.mail.slot / mail_count_done (integer) : NEW | ||
| event / event.mail.slot / mail_done (boolean) : NEW | ||
| event / event.mail.slot / scheduled_date (datetime) : NEW isfunction: function, stored | ||
| event / event.mail.slot / scheduler_id (many2one) : NEW relation: event.mail, required | ||
| event / event.question / active (boolean) : NEW hasdefault: default | ||
|
|
||
| # NOTHING TO DO | ||
|
|
||
| event / event.question / event_id (many2one) : DEL relation: event.event | ||
| event / event.question / event_ids (many2many) : NEW relation: event.event | ||
| event / event.question / event_type_id (many2one) : DEL relation: event.type | ||
| event / event.question / event_type_ids (many2many) : NEW relation: event.type | ||
|
|
||
| # DONE: converted in post-migration | ||
|
|
||
| event / event.question / is_default (boolean) : NEW | ||
| event / event.question / is_reusable (boolean) : NEW isfunction: function, stored | ||
|
|
||
| # DONE: precreated with value False | ||
|
|
||
| event / event.registration / event_begin_date (datetime) : not related anymore | ||
| event / event.registration / event_begin_date (datetime) : now a function | ||
| event / event.registration / event_end_date (datetime) : not related anymore | ||
| event / event.registration / event_end_date (datetime) : now a function | ||
|
|
||
| # NOTHING TO DO: nonstored | ||
|
|
||
| event / event.registration / event_slot_id (many2one) : NEW relation: event.slot | ||
| event / event.slot / color (integer) : NEW hasdefault: default | ||
| event / event.slot / date (date) : NEW required | ||
| event / event.slot / end_datetime (datetime) : NEW isfunction: function, stored | ||
| event / event.slot / end_hour (float) : NEW required | ||
| event / event.slot / event_id (many2one) : NEW relation: event.event, required | ||
| event / event.slot / registration_ids (one2many) : NEW relation: event.registration | ||
| event / event.slot / start_datetime (datetime) : NEW isfunction: function, stored | ||
| event / event.slot / start_hour (float) : NEW required | ||
| event / event.stage / legend_blocked (char) : DEL required | ||
| event / event.stage / legend_done (char) : DEL required | ||
| event / event.stage / legend_normal (char) : DEL required | ||
|
|
||
| # NOTHING TO DO | ||
|
|
||
| event / event.type / question_ids (one2many) : table is now 'event_question_event_type_rel' ('False') | ||
| event / event.type / question_ids (one2many) : type is now 'many2many' ('one2many') | ||
|
|
||
| # DONE: converted to many2many | ||
|
|
||
| event / event.type.mail / interval_type (selection) : selection_keys added: [after_event_start, before_event_end] (most likely nothing to do) | ||
|
|
||
| # NOTHING TO DO | ||
|
|
||
| ---XML records in module 'event'--- | ||
| NEW event.question: event.event_question_email (noupdate) | ||
| NEW event.question: event.event_question_name (noupdate) | ||
| NEW event.question: event.event_question_phone (noupdate) | ||
| DEL event.stage: event.event_stage_cancelled (noupdate) | ||
| NEW ir.actions.act_window: event.event_question_action | ||
| NEW ir.actions.act_window: event.event_slot_action_from_event | ||
| DEL ir.actions.client: event.event_action_install_kiosk_pwa | ||
| DEL ir.actions.report: event.action_report_event_registration_badge_96x134 | ||
| DEL ir.actions.report: event.action_report_event_registration_badge_96x82 | ||
| NEW ir.model.access: event.access_event_mail_slot_manager | ||
| NEW ir.model.access: event.access_event_mail_slot_registration | ||
| NEW ir.model.access: event.access_event_slot_registration | ||
| NEW ir.model.access: event.access_event_slot_user | ||
| NEW ir.model.constraint: event.constraint_event_question_check_default_question_is_reusable | ||
| NEW ir.ui.menu: event.event_question_menu | ||
| NEW ir.ui.view: event.event_question_view_list | ||
| NEW ir.ui.view: event.event_question_view_list_add | ||
| NEW ir.ui.view: event.event_question_view_search | ||
| NEW ir.ui.view: event.view_event_slot_calendar | ||
| NEW ir.ui.view: event.view_event_slot_form | ||
| NEW ir.ui.view: event.view_event_slot_multi_create_form | ||
| NEW ir.ui.view: event.view_event_slot_tree | ||
| DEL ir.ui.view: event.event_report_template_esc_label_96x134_badge | ||
| DEL ir.ui.view: event.event_report_template_esc_label_96x82_badge | ||
| NEW res.groups.privilege: event.res_groups_privilege_events | ||
|
|
||
| # 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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the switch of the cron to 24 should be mitigated, as we may change the cron period or unit previously.
And I miss the changes for
event_question_nameand company for the new fieldsis_defaultandis_reusablethat are in https://github.com/odoo/odoo/blob/19.0/addons/event/data/event_question_data.xml