[FW][FIX] stock: remove mto link when product is stolen #162887
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
A lot of users don't understand why they can't reserve after moving a product with an immediate transfer. It's due to the double check of _action_assign that check where the move orig stored the product and check the quants for this exact location. In our case the product was moved so the match doesn't work.
We introduce an new parameter to check if modifying the behavior on those cases would work. When _free_reservation is call on a move.line we expect to never find it at this place anymore (except if we bring it back). Then we drop the reservation base on MTO process and only check if there is a quantity in a sub location of the stock.move
Description of the issue/feature this PR addresses:
Current behavior before PR:
Desired behavior after PR is merged:
I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr
Forward-Port-Of: #155118
Forward-Port-Of: #154912