Thanks to visit codestin.com
Credit goes to Github.com

Skip to content

[16.0][FIX] shopfloor: Fetch qty_available only when needed#1055

Merged
OCA-git-bot merged 1 commit intoOCA:16.0from
acsone:16.0-shopfloor-sbj
Feb 20, 2026
Merged

[16.0][FIX] shopfloor: Fetch qty_available only when needed#1055
OCA-git-bot merged 1 commit intoOCA:16.0from
acsone:16.0-shopfloor-sbj

Conversation

@sbejaoui
Copy link

@sbejaoui sbejaoui commented Jun 18, 2025

Several services use _data_move_line to prepare stock move line data for the Shopfloor frontend. However, qty_available is not displayed on all pages where stock move lines are handled.

Since qty_available is computed from quants, accessing it unnecessarily can lead to useless database queries. In high-concurrency environments, this can even trigger deadlocks when reads and writes occur simultaneously across many Shopfloor users.

This fix limits the use of qty_available to cases where it’s strictly needed.

image

@lmignon , @rousseldenis

@OCA-git-bot
Copy link
Contributor

Hi @simahawk, @guewen, @sebalix,
some modules you are maintaining are being modified, check this out!

@sbejaoui sbejaoui changed the title [FIX] shopfloor: Fetch qty_available only when needed [16.0][FIX] shopfloor: Fetch qty_available only when needed Jun 18, 2025
Copy link

@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.

Great !

Copy link

@lmignon lmignon left a comment

Choose a reason for hiding this comment

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

Do you've analyzed the domain used in such a case. The qty available is computed for a specific location. I find it hard to believe that there are several people at the same time asking for the same quantity of the same product for the same location... In any case, if you don't need the field because you don't display it, it's time saved.

@sbejaoui
Copy link
Author

Do you've analyzed the domain used in such a case. The qty available is computed for a specific location. I find it hard to believe that there are several people at the same time asking for the same quantity of the same product for the same location... In any case, if you don't need the field because you don't display it, it's time saved.

The quantity is not relevant; the issue is related to the same product from the same location, and it occurs consistently based on the data I analyzed in our use case.

Copy link

@simahawk simahawk left a comment

Choose a reason for hiding this comment

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

make sense

@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). 🤖

@github-actions
Copy link

github-actions bot commented Nov 2, 2025

There hasn't been any activity on this pull request in the past 4 months, so it has been marked as stale and it will be closed automatically if no further activity occurs in the next 30 days.
If you want this PR to never become stale, please ask a PSC member to apply the "no stale" label.

@github-actions github-actions bot added the stale PR/Issue without recent activity, it'll be soon closed automatically. label Nov 2, 2025
@github-actions github-actions bot closed this Dec 7, 2025
@jbaudoux jbaudoux reopened this Dec 8, 2025
@OCA-git-bot
Copy link
Contributor

Hi @simahawk, @guewen, @sebalix,
some modules you are maintaining are being modified, check this out!

@github-actions github-actions bot removed the stale PR/Issue without recent activity, it'll be soon closed automatically. label Dec 14, 2025
@jbaudoux
Copy link
Contributor

ping @sbejaoui

Several services use `_data_move_line` to prepare stock move line data
for the Shopfloor frontend. However, qty_available is not displayed on
all pages where stock move lines are handled.

Since qty_available is computed from quants, accessing it unnecessarily
can lead to useless database queries. In high-concurrency environments,
this can even trigger deadlocks when reads and writes occur simultaneously
across many Shopfloor users.

This fix limits the use of qty_available to cases where it’s strictly needed.
@sbejaoui
Copy link
Author

changes made, please review

@jbaudoux
Copy link
Contributor

/ocabot merge minor

@OCA-git-bot
Copy link
Contributor

What a great day to merge this nice PR. Let's do it!
Prepared branch 16.0-ocabot-merge-pr-1055-by-jbaudoux-bump-minor, awaiting test results.

@OCA-git-bot OCA-git-bot merged commit b54fa1f into OCA:16.0 Feb 20, 2026
6 of 7 checks passed
@OCA-git-bot
Copy link
Contributor

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

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.

7 participants