Skip to content

[16.0][IMP] stock_quant_manual_assign: Improve assign_quants() performance #2312

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

Open
wants to merge 1 commit into
base: 16.0
Choose a base branch
from

Conversation

AungKoKoLin1997
Copy link
Contributor

@AungKoKoLin1997 AungKoKoLin1997 commented Apr 7, 2025

Previously, when there were hundreds of quants assigned to a stock move, it would take a very long time for assign_quants() to complete, as the system would try to reassign all selected quants.

This PR mitigates the issue by identifying only the necessary changes — specifically, the move lines to be unlinked and the quant lines to be assigned — so that updates are made only to those records.

@qrtl QT5295

@AungKoKoLin1997 AungKoKoLin1997 force-pushed the 16.0-oca-imp-stock_quant_manual_assign branch from 5e5fec8 to 01efa4d Compare April 7, 2025 09:51
@AungKoKoLin1997 AungKoKoLin1997 force-pushed the 16.0-oca-imp-stock_quant_manual_assign branch from 01efa4d to 58873d2 Compare April 8, 2025 01:12
Copy link
Member

@yostashiro yostashiro left a comment

Choose a reason for hiding this comment

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

LGTM.

Copy link
Contributor

@rousseldenis rousseldenis left a comment

Choose a reason for hiding this comment

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

@AungKoKoLin1997 Thanks for this. Could you add tests that cover the move lines to unlink case ?

@AungKoKoLin1997 AungKoKoLin1997 force-pushed the 16.0-oca-imp-stock_quant_manual_assign branch from 58873d2 to 737a57a Compare April 9, 2025 10:50
@AungKoKoLin1997 AungKoKoLin1997 force-pushed the 16.0-oca-imp-stock_quant_manual_assign branch from 737a57a to 755307c Compare April 10, 2025 02:24
@AungKoKoLin1997 AungKoKoLin1997 force-pushed the 16.0-oca-imp-stock_quant_manual_assign branch from 755307c to 3780f83 Compare April 10, 2025 07:30
@AungKoKoLin1997 AungKoKoLin1997 force-pushed the 16.0-oca-imp-stock_quant_manual_assign branch 4 times, most recently from b1d2cfc to cdaa609 Compare April 10, 2025 10:25
Previously, when there were hundreds of quants assigned to a stock move, it
would take a very long time for assign_quants() to complete, as the system
would try to reassign all selected quants.

This commit mitigates the issue by identifying only the necessary changes —
specifically, the move lines to be unlinked and the quant lines to be
assigned — so that updates are made only to those records.

Co-Authored-By: Yoshi Tashiro <tashiro@quartile.co>
@AungKoKoLin1997 AungKoKoLin1997 force-pushed the 16.0-oca-imp-stock_quant_manual_assign branch from cdaa609 to ad5b398 Compare April 10, 2025 10:36
Copy link
Member

@yostashiro yostashiro left a comment

Choose a reason for hiding this comment

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

LGTM.

@AungKoKoLin1997
Copy link
Contributor Author

@rousseldenis Could you please review the PR?

Copy link
Contributor

@rousseldenis rousseldenis left a comment

Choose a reason for hiding this comment

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

LGTM

@OCA-git-bot
Copy link
Contributor

This PR has the approved label and has been created more than 5 days ago. It should therefore be ready to merge by a maintainer (or a PSC member if the concerned addon has no declared maintainer). 🤖

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