Skip to content

[19.0][MIG] event: slots + question m2m promotion#5637

Open
dnplkndll wants to merge 1 commit into
OCA:19.0from
ledoent:19.0-mig-event-slots-questions
Open

[19.0][MIG] event: slots + question m2m promotion#5637
dnplkndll wants to merge 1 commit into
OCA:19.0from
ledoent:19.0-mig-event-slots-questions

Conversation

@dnplkndll
Copy link
Copy Markdown

@dnplkndll dnplkndll commented May 15, 2026

Summary

19.0 reshapes event.question:

  • event_id (many2one) → event_ids (many2many)
  • event_type_id (many2one) → event_type_ids (many2many)

The reverse sides on event.event (question_ids, general_question_ids, specific_question_ids) and on event.type (question_ids) also flip from one2many to many2many, all sharing the new join tables event_event_event_question_rel and event_question_event_type_rel.

Approach:

  1. pre-migration: rename the legacy FK columns on event_question via `get_legacy_name()` so they survive ORM init.
  2. post-migration: `INSERT ... SELECT` from the legacy columns into the two new join tables. The reverse o2m sides read from the same data — no extra work.

Two new pure-addition models (event.slot, event.mail.slot) are created by ORM at init time. Selection-key shrink on event.event.badge_format and DEL required fields on event.stage are left to database_cleanup per maintainer policy. Same for the DEL event.event_stage_cancelled data record.

The 5 simple event_* submodules ship in a sibling PR.

Test plan

  • pre-commit run --files <changed> clean
  • Fork CI Test OpenUpgrade migration green on ledoent/19.0-mig-test-event-slots-questions
  • Log confirms expected row counts on OCA seed DB:
    • `32 rows affected` into `event_event_event_question_rel`
    • `10 rows affected` into `event_question_event_type_rel`
  • OCA CI green

@OCA-git-bot OCA-git-bot added mod:openupgrade_scripts Module openupgrade_scripts series:19.0 labels May 15, 2026
@dnplkndll dnplkndll force-pushed the 19.0-mig-event-slots-questions branch from edcca6a to 7ab2ce2 Compare May 15, 2026 21:42
Stage migration for the v19 event module overhaul:

* event.question.event_id (m2o) and event.question.event_type_id (m2o)
  are promoted to many2many fields (event_ids / event_type_ids).
  Pre-migration renames the legacy FK columns via get_legacy_name so
  they survive ORM init; post-migration copies them into the new join
  tables event_event_event_question_rel and event_question_event_type_rel.
  This same data also powers the reverse o2m->m2m promotions on
  event.event.question_ids / general_question_ids / specific_question_ids
  and event.type.question_ids — no extra work needed.

* New models event.slot and event.mail.slot are pure additions
  (Odoo creates the tables; data is event-instance specific).

* Selection-key removals on event.event.badge_format and DEL required
  fields on event.stage are left to database_cleanup per maintainer
  policy. Same for the DEL event.event_stage_cancelled data record.
@dnplkndll dnplkndll force-pushed the 19.0-mig-event-slots-questions branch from 7ab2ce2 to 753bcc9 Compare May 19, 2026 01:16
@dnplkndll dnplkndll marked this pull request as ready for review May 19, 2026 01:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

mod:openupgrade_scripts Module openupgrade_scripts series:19.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants