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

[FIX] stock: properly calculate stock at planned date #162696

Closed
wants to merge 2 commits into from

Conversation

wtaferner
Copy link
Contributor

Description of the issue/feature this PR addresses:
Currently the decision is always taken based on free quantity which is available quantity - reserved qty and therefore does not take into consideration future deliveries or already ordered quantities incoming today or in the future.

Thus, when there is a planned date in procurement we calculate the scheduled date to determine at which point in time we would expect the fulfillment of the procurement and see if there is a need to procure based on MTO or not and act accordingly.

Current behavior before PR:
Unrelated if there is already an inbound order planned, mto is used if not enough quantity is available now

Desired behavior after PR is merged:
Taking into consideration the virtual quantity at the point in time where we want to fulfill the order determines whether or not MTO is triggered.

Info: @wt-io-it


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

@robodoo
Copy link
Contributor

robodoo commented Apr 19, 2024

@C3POdoo C3POdoo requested a review from a team April 19, 2024 17:53
@C3POdoo C3POdoo added the Logistics about stock, mrp, delivery, purchase label Apr 19, 2024
@wtaferner wtaferner marked this pull request as draft April 19, 2024 18:37
@wtaferner wtaferner marked this pull request as ready for review April 20, 2024 05:25
@wtaferner wtaferner force-pushed the 15.0-fix_mts_else_mto-wt branch 2 times, most recently from 4c55387 to 3ed97ca Compare April 20, 2024 07:09
+ isolated tests failed with can't adapt res.partner
Currently the decision is always taken based on free quantity which
is available quantity - reserved qty and therefore does not take into
consideration future deliveries or already ordered quantities incoming
today or in the future.

Thus, when there is a planned date in procurement we calculate the scheduled
date to determine at which point in time we would expect the fulfillment of the
procurement and see if there is a need to procure based on MTO or not and act
accordingly.
@amoyaux
Copy link
Contributor

amoyaux commented Apr 25, 2024

Hey @wtaferner it seems to be a big behavior change in stable. I'm a bit afraid to do this. Also the patch only check for the min schedule date which could be not true neither if procurements have different planned date.
However we are currently improving MTSO and we will handle this kind of usecases. You can find the PR here #147112

@wtaferner
Copy link
Contributor Author

@amoyaux
No worries, thx for letting me know that it is improved/fixed at least for 18.0. Therefore I am closing this PR and just use it for my own purposes or others can take it if stumbling over it.
The change in 18.0 looks rather big, so hope you guys tackle all the important use cases and stuff in relation to that...not sure if I can help and review, but at least I will follow what is done in the end.

Have a great day! 😄

@wtaferner wtaferner closed this Apr 25, 2024
@wtaferner wtaferner deleted the 15.0-fix_mts_else_mto-wt branch April 25, 2024 10:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Logistics about stock, mrp, delivery, purchase
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants