[19.0][OU-ADD] crm: stage.team_id m2o→m2m promotion#5643
Conversation
72f6b98 to
66cc730
Compare
|
/ocabot migration crm @dnplkndll Please avoid:
|
66cc730 to
bc17267
Compare
remi-filament
left a comment
There was a problem hiding this comment.
Thanks @dnplkndll for your PR
| crm / res.users / target_sales_done (integer) : DEL | ||
| crm / res.users / target_sales_won (integer) : DEL | ||
|
|
||
| # DONE: crm.stage.team_id (m2o) -> team_ids (m2m) promotion handled by |
There was a problem hiding this comment.
Comments should be just after concerned lines, marking the other ones as NOTHING TO DO
There was a problem hiding this comment.
Restructured in bea32d3 — per-group markers in the work doc. # DONE only next to the m2o→m2m promotion lines (event.question.event_id / event_type_id); other lines under # NOTHING TO DO.
| def migrate(env, version): | ||
| """Populate crm.stage.team_ids m2m from legacy team_id (m2o -> m2m promotion).""" | ||
| legacy = openupgrade.get_legacy_name("team_id") | ||
| openupgrade.logged_query( |
There was a problem hiding this comment.
You have an helper method on openupgradelib doing the same m2o_to_x2m()
I do not think that you need to rename the field beforehand anyhow since they do not have the same name it should be preserved by OpenUpgrade
There was a problem hiding this comment.
Done in bea32d3 — pre-migration removed entirely. Post-migration now uses openupgrade.m2o_to_x2m(env.cr, env['crm.stage'], 'crm_stage', 'team_ids', 'team_id') against the auto-preserved team_id column. Single 5-line function.
bc17267 to
bea32d3
Compare
|
@remi-filament — addressed both threads in bea32d3:
Title also tightened ( |
hbrunn
left a comment
There was a problem hiding this comment.
the commit message does not describe what the code does. Generally, please tone down the chattiness of your bullshit generator by 100.
I don't think the tests are very helpful here, the first fails in some corner cases like no stages at all in the DB, the second tests openupgradelib standard functionality. For such simple cases, I'd suggest no tests at all.
And the commit message title doesn't need to describe details, it's just the whole of the migration for crm.
bb48820 to
1b759a8
Compare
1b759a8 to
aeae85d
Compare
19.0 promotes
crm.stage.team_id(m2o →crm.team) toteam_ids(m2m). Without explicit migration the per-stage team assignment is lost.Since the new field has a different name, OpenUpgrade preserves the old column automatically — no pre-migration rename needed. Post-migration uses
openupgrade.m2o_to_x2m()to populate the new join table, followed byload_datato reload the noupdate PLS config parameter (which gainswon_statusin 19.0).Non-mechanical adaptations worth flagging
crm.stage.team_id→team_ids: preserved by OCA auto-rename; post-migrationm2o_to_x2mpopulatescrm_stage_crm_team_rel.noupdate_changes.xmlloaded:crm_pls_fields_paramaddswon_statusto the PLS field list for 19.0; default stage colors reloaded.