Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[MIG][15.0] stock: migration script #3302

Closed
wants to merge 1 commit into from

Conversation

sang250399
Copy link

This PR

Migration done

@legalsylvain
Copy link
Contributor

/ocabot migration stock

@OCA-git-bot OCA-git-bot added this to the 15.0 milestone Jun 20, 2022
Copy link

@gdgellatly gdgellatly left a comment

Choose a reason for hiding this comment

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

I just static review, but I am not very good at this, it is more for other reviewers to confirm if I am stupid than for dev to take action.

env.cr,
"""
UPDATE stock_quant_package
SET name = 'Unknown Pack'

Choose a reason for hiding this comment

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

Is there a chance we get a lot of these?

Maybe

Suggested change
SET name = 'Unknown Pack'
SET name = 'Unknown Pack ' || id::text

I never use packages so maybe it is irrelevant, just a comment.

Choose a reason for hiding this comment

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

This field is required from 15.0, but at 14.0 it was set default value via self.env['ir.sequence'].next_by_code('stock.quant.package') and didn't insert by SQL before. So I think we don't need set value for it during migration from 14.0 to 15.0.

Choose a reason for hiding this comment

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

After reviewing, I think we still need to migrate here. Although stock.quant.package are usually created via transfers but it has some views and end user can edit it. It mean name of stock.quant.package can be blank.

env.cr,
"""
UPDATE stock_quant_package
SET name = 'Unknown Pack'

Choose a reason for hiding this comment

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

This field is required from 15.0, but at 14.0 it was set default value via self.env['ir.sequence'].next_by_code('stock.quant.package') and didn't insert by SQL before. So I think we don't need set value for it during migration from 14.0 to 15.0.

@MiquelRForgeFlow
Copy link
Contributor

Superseded by #3510.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants