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

[10.0][PERF] Perf improvement when migrating stock module #2151

Merged
merged 1 commit into from Jan 3, 2020

Conversation

sebastienbeau
Copy link
Member

Description of the issue/feature this PR addresses:

Adding related field with the ORM is long

Current behavior before PR:

On my database adding the fields stock_move.scrapped and stock_production_lot.product_uom_id
take 4 hours. Around 3.5 million of stock move and 1.3 million of stock production lot

Desired behavior after PR is merged:

It only take 30 min

--
I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr

@sebastienbeau sebastienbeau changed the title Perf improvement on stock module [10.0][PERF] Perf improvement when migrating stock module Jan 3, 2020
@pedrobaeza pedrobaeza added this to the 10.0 milestone Jan 3, 2020
Copy link
Member

@pedrobaeza pedrobaeza left a comment

Choose a reason for hiding this comment

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

All performance improvements are welcome!

@pedrobaeza
Copy link
Member

/ocabot merge

@OCA-git-bot
Copy link
Contributor

Hey, thanks for contributing! Proceeding to merge this for you.
Prepared branch 10.0-ocabot-merge-pr-2151-by-pedrobaeza-bump-no, awaiting test results.

@OCA-git-bot
Copy link
Contributor

@pedrobaeza your merge command was aborted due to failed check(s), which you can inspect on this commit of 10.0-ocabot-merge-pr-2151-by-pedrobaeza-bump-no.

After fixing the problem, you can re-issue a merge command. Please refrain from merging manually as it will most probably make the target branch red.

@pedrobaeza
Copy link
Member

Please fix flake8:

./addons/stock/migrations/10.0.1.1/pre-migration.py:66:1: E302 expected 2 blank lines, found 1
./addons/stock/migrations/10.0.1.1/pre-migration.py:80:1: E302 expected 2 blank lines, found 1

Adding the related store field with the ORM is slow
This PR add it manually the fields
- stock_move.scrapped
- stock_production_lot.product_uom_id
Manually bypassing the ORM
Reduce time from 4 hours to 30 minutes
@sebastienbeau
Copy link
Member Author

Sorry for the pep8, it should be fixed now, waiting for travis.
Thanks for your quick review !

@StefanRijnhart
Copy link
Member

Thanks!

@pedrobaeza
Copy link
Member

/ocabot merge

@OCA-git-bot
Copy link
Contributor

What a great day to merge this nice PR. Let's do it!
Prepared branch 10.0-ocabot-merge-pr-2151-by-pedrobaeza-bump-no, awaiting test results.

OCA-git-bot added a commit that referenced this pull request Jan 3, 2020
Signed-off-by pedrobaeza
@OCA-git-bot OCA-git-bot merged commit b7cdcd0 into OCA:10.0 Jan 3, 2020
@OCA-git-bot
Copy link
Contributor

Congratulations, your PR was merged at d251743. Thanks a lot for contributing to OCA. ❤️

@sebastienbeau
Copy link
Member Author

Thanks for merging so fast the PR.
I will propose other perf improvement !

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.

None yet

4 participants