[16.0][FW] stock_available_to_promise_release: Backports from 18.0#1151
Open
[16.0][FW] stock_available_to_promise_release: Backports from 18.0#1151
Conversation
…cking When creating the return picking for moved goods on unrelease operations, we are forcing 'Stock' (ie the default location of return picking type) as a destination location, through context of return picking wizard. However, this context key was only used on the preparation of the return move values, whereas the return picking had its destination location set to the source location of the picking being returned. Hence, when the partner was set on the return picking (through purchase_stock override), it was triggering recomputation of the destination location on the stock move, overwriting the forced destination location from the return picking type. By using the location value provided through context to create the return wizard when preparing the return picking values, we ensure any recomputation will not overwrite said value on the stock move.
…cation The warehouse is used for computing available stock. Allow to view if the warehouse is set.
Do not unrelease when 2 released moves are merged and do not send pre-released move to a backorder.
ee68327 to
5dcd97a
Compare
Add support to send released moves to a split order. Always force a new picking on assignation. The condition is already checked before calling action_assign. Improve backorder link with origin and posted message. Call hookable before_release before sending remaining moves to backorder as the hook could manage the way backorders are created (see carrier alternative).
When a move partially available is released, a new move is created for the remaining quantity. If the released move gets a new picking type, he cannot loose it's priority in favor of the remaining quantity move. Revert of OCA#441
Fix loop, do not override function argument on first iteration
Fix migration to v18.0
- Fix query for horizon - Fix split of move, ensure need_release is propagated
The procure_method is propagated since odoo v15.0. This is now obsolete.
Ensure released moves are not marked anymore as need_release before defer is called
On run_defer, _action_confirm already calls _action_assign, no need to run it a second time
5dcd97a to
a0d940a
Compare
lmignon
approved these changes
Apr 10, 2026
lmignon
left a comment
There was a problem hiding this comment.
😲 🤔 😲 That's a lot of tricky changes. Fortunately, there are plenty of tests, because with this level of complexity, it’s not easy to understand everything. Everything seems to make sense to me. The test of fire will tell... Thank you for the backport
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Backport of PRs:
cc @lmignon @cyrilmanuel @rousseldenis