diff --git a/docsource/modules180-190.rst b/docsource/modules180-190.rst index fd4b86e2175e..b7deec1966ad 100644 --- a/docsource/modules180-190.rst +++ b/docsource/modules180-190.rst @@ -134,7 +134,7 @@ Module coverage 18.0 -> 19.0 +---------------------------------------------------+----------------------+-------------------------------------------------+ | digest |Done |No DB layout changes. | +---------------------------------------------------+----------------------+-------------------------------------------------+ -| event | | | +| event |Done | | +---------------------------------------------------+----------------------+-------------------------------------------------+ | event_booth | | | +---------------------------------------------------+----------------------+-------------------------------------------------+ diff --git a/openupgrade_scripts/scripts/event/19.0.1.9/noupdate_changes_work.xml b/openupgrade_scripts/scripts/event/19.0.1.9/noupdate_changes_work.xml new file mode 100644 index 000000000000..b30b5c1c60e7 --- /dev/null +++ b/openupgrade_scripts/scripts/event/19.0.1.9/noupdate_changes_work.xml @@ -0,0 +1,294 @@ + + + + 24 + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + +
+ Your registration +
+ + Guest + + +
+ + Download Badges + + + + +
+
+
+
+ + + + + + + +
+
+ Guest + Hello ,
+
+ Please find attached your badge for + + OpenWood Collection Online Reveal + + + OpenWood Collection Online Reveal. + +
+
+ + + + + + + +
+ Add this event to your calendar + + + iCal + + + + Outlook + + + + Google + +
+
+
+
+ See you soon,
+ + --
+ + YourCompany + + + The OpenWood Collection Online Reveal Team + +
+
+
+
+
+
+ + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + +
+ + +
+ May 4, 2021 + 7:00 AM + - 5:00 PM +
+
+ From + May 4, 2021 - 7:00 AM +
+ To + May 6, 2021 - 5:00 PM +
+
+ (Europe/Brussels) +
+
+ + + + + + + +
Teksa SpA
+
+ +
Puerto Madero 9710
+ + + +
Of A15, Santiago (RM)
+ + +
+ + Pudahuel, + + + + C1, + + + + 98450 + + +
+ +
Argentina
+ + +
+
+
+ +
+
+
+ + +
+ Questions about this event? +
Please contact the organizer:
+ +
+
+
+ + +
+
+
+ + +
+ Get the best mobile experience. + Install our mobile app +
+
+
+ + +
+
+
+ + + + + + +
+ +
+
+
+
+
+ + + + + +
+ Sent by YourCompany + +
+ Discover all our events. +
+
+
+
+
+ + +
+
diff --git a/openupgrade_scripts/scripts/event/19.0.1.9/post-migration.py b/openupgrade_scripts/scripts/event/19.0.1.9/post-migration.py new file mode 100644 index 000000000000..377fc86f791d --- /dev/null +++ b/openupgrade_scripts/scripts/event/19.0.1.9/post-migration.py @@ -0,0 +1,26 @@ +from openupgradelib import openupgrade + + +@openupgrade.migrate() +def migrate(env, version): + 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.load_data(env, "event", "19.0.1.9/noupdate_changes_work.xml") + # The reloaded event_registration_mail_template_badge carries a changed + # body_html; drop stale 18.0 per-language translations so non-English users + # see the 19.0 source instead of a shadowing old translation. + openupgrade.delete_record_translations( + env.cr, "event", ["event_registration_mail_template_badge"], ["body_html"] + ) diff --git a/openupgrade_scripts/scripts/event/19.0.1.9/pre-migration.py b/openupgrade_scripts/scripts/event/19.0.1.9/pre-migration.py new file mode 100644 index 000000000000..4ca0cbdff92c --- /dev/null +++ b/openupgrade_scripts/scripts/event/19.0.1.9/pre-migration.py @@ -0,0 +1,42 @@ +from openupgradelib import openupgrade + + +@openupgrade.migrate() +def migrate(env, version): + # 19.0 drops the Cancelled stage in favour of kanban_state='cancel'. + # event.event.stage_id is ondelete='restrict', so remap cancelled events + # onto the surviving Ended stage (flagged cancelled) before removing the + # stage and its ir_model_data row. Pure SQL: event's models are not in + # the registry during its own pre-migration, so env.ref cannot be used. + env.cr.execute( + """ + SELECT name, res_id FROM ir_model_data + WHERE module = 'event' AND model = 'event.stage' + AND name IN ('event_stage_cancelled', 'event_stage_done') + """ + ) + stages = dict(env.cr.fetchall()) + cancelled = stages.get("event_stage_cancelled") + done = stages.get("event_stage_done") + if not cancelled: + return + if done: + openupgrade.logged_query( + env.cr, + """ + UPDATE event_event + SET stage_id = %s, kanban_state = 'cancel' + WHERE stage_id = %s + """, + (done, cancelled), + ) + openupgrade.logged_query( + env.cr, "DELETE FROM event_stage WHERE id = %s", (cancelled,) + ) + openupgrade.logged_query( + env.cr, + """ + DELETE FROM ir_model_data + WHERE module = 'event' AND name = 'event_stage_cancelled' + """, + ) diff --git a/openupgrade_scripts/scripts/event/19.0.1.9/upgrade_analysis_work.txt b/openupgrade_scripts/scripts/event/19.0.1.9/upgrade_analysis_work.txt new file mode 100644 index 000000000000..10b8f6b03f38 --- /dev/null +++ b/openupgrade_scripts/scripts/event/19.0.1.9/upgrade_analysis_work.txt @@ -0,0 +1,119 @@ +---Models in module 'event'--- +new model event.mail.slot +new model event.slot + +# NOTHING TO DO + +---Fields in module 'event'--- +event / event.event / badge_format (selection) : selection_keys removed: [96x134, 96x82] +event / event.event / event_slot_ids (one2many) : NEW relation: event.slot +event / event.event / event_url (char) : NEW hasdefault: compute + +# NOTHING TO DO + +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: reverse side of event.question.event_id m2o->m2m promotion — reads from event_event_event_question_rel populated in post-migration + +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: same reverse side as general_question_ids — m2m table populated in post-migration + +event / event.event.ticket / limit_max_per_order (integer) : NEW hasdefault: default +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: post-migration: m2o_to_x2m promotes event_id->event_ids and event_type_id->event_type_ids + +event / event.question / is_default (boolean) : NEW +event / event.question / is_reusable (boolean) : NEW isfunction: function, stored +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 +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: reverse side of event.question.event_type_id m2o->m2m promotion — reads from event_question_event_type_rel populated in post-migration + +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) + +# NOTHING TO DO + +DEL event.stage: event.event_stage_cancelled (noupdate) + +# DONE: pre-migration remaps cancelled events to the Ended stage + kanban_state='cancel' +# (stage_id is ondelete=restrict), then deletes the noupdate stage + imd row (SQL — +# event's models aren't registered during its own pre-migration) + +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