Skip to content

[19.0][OU-ADD] crm: Migration scripts#5706

Open
eduezerouali-tecnativa wants to merge 1 commit into
OCA:19.0from
Tecnativa:19.0-ou-add-crm
Open

[19.0][OU-ADD] crm: Migration scripts#5706
eduezerouali-tecnativa wants to merge 1 commit into
OCA:19.0from
Tecnativa:19.0-ou-add-crm

Conversation

@eduezerouali-tecnativa

Copy link
Copy Markdown
Contributor

cc @Tecnativa TT58614
@pedrobaeza

@legalsylvain

legalsylvain commented Jun 9, 2026

Copy link
Copy Markdown
Contributor

@OCA-git-bot OCA-git-bot added this to the 19.0 milestone Jun 9, 2026
Comment thread openupgrade_scripts/scripts/crm/19.0.1.9/post-migration.py Outdated
Comment thread openupgrade_scripts/scripts/crm/19.0.1.9/post-migration.py Outdated
Comment thread openupgrade_scripts/scripts/crm/19.0.1.9/post-migration.py
# NOTHING TO DO

crm / crm.lead / mobile (char) : DEL
# DONE: if phone is empty and mobile not set phone with mobile

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should concatenate the mobile in the pone field in case both exist, or write it on the internal notes to not lose data. And put if done in pre-migration or post-migration.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I had the feeling more case can appear so I tag it as case 1. If we concatenate that, can this cause trouble with phone_validation ?

# NOTHING TO DO

crm / crm.lead / won_status (selection) : NEW selection_keys: ['lost', 'pending', 'won'], isfunction: function, stored
#DONE: set to prevent massive compute

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
#DONE: set to prevent massive compute
# DONE: pre-migration: pre-created column and set it to prevent massive computation

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And I see you have done it on post-migration, so this is not preventing anything.


crm / crm.stage / team_id (many2one) : DEL relation: crm.team
crm / crm.stage / team_ids (many2many) : NEW relation: crm.team
# Done: Transform m2o to m2m

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
# Done: Transform m2o to m2m
# DONE: post-migration: Transform m2o to m2m

@openupgrade.migrate()
def migrate(env, version):
# do not load noupdate_changes.xml, because all entries are problematic
# the necessary changes are done manually in the _load_data_* functions below

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why the color loading in the stages is problematic? cc @hbrunn

@eduezerouali-tecnativa eduezerouali-tecnativa Jun 16, 2026

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I assume that is because what happens if those records were eliminated by the user, but in this can be manged by the https://github.com/OCA/openupgradelib/blob/ac165a1dccd1fba4f09fb15c194420cdaa4672af/openupgradelib/openupgrade.py#L434
Am i wrong?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it's indeed problematic when the stages are deleted. for this hack to be active, you need to pass mode='init_no_create', and then also pass an xml transformation to remove overwriting the config parameter. also a way to go, but not really simpler than what happens now. would be future proof for subsequent changes to the file though

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK, the forcecreate="False" parameter is the defining one. Then please:

  • Specify the real reasons, not only to mention "conflicting".
  • Put the load_data instruction, but commented, to give context.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants