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
@OCA-git-bot OCA-git-bot mentioned this pull request Jun 9, 2026
87 tasks

@openupgrade.migrate()
def migrate(env, version):
openupgrade.load_data(env, "crm", "19.0.1.9/noupdate_changes.xml")

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 all those values are problematic. The writes on stage records will break if the user has deleted them in v18, and crm_pls_fields_param might have been customized.

This is one of the very few cases where I'd suggest to not load the file, but write code to do the updates conditionally. For the param something like ','.join(set(param.split(',')) | set('new', 'fields'))

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.

Done

UPDATE crm_lead cl
SET won_status = CASE
WHEN cl.probability = 100
AND EXISTS (

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.

this should be a left join

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.

Done

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.

4 participants