Skip to content

[16.0][FW] stock_available_to_promise_release: Backports from 18.0#1151

Open
jbaudoux wants to merge 14 commits intoOCA:16.0from
jbaudoux:oca-port-stock_available_to_promise_release-18.0-to-16.0-88bc39
Open

[16.0][FW] stock_available_to_promise_release: Backports from 18.0#1151
jbaudoux wants to merge 14 commits intoOCA:16.0from
jbaudoux:oca-port-stock_available_to_promise_release-18.0-to-16.0-88bc39

Conversation

grindtildeath and others added 5 commits April 9, 2026 14:15
…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.
@jbaudoux jbaudoux force-pushed the oca-port-stock_available_to_promise_release-18.0-to-16.0-88bc39 branch from ee68327 to 5dcd97a Compare April 9, 2026 12:58
@jbaudoux jbaudoux marked this pull request as ready for review April 9, 2026 12:58
jbaudoux added 9 commits April 9, 2026 15:01
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 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
@jbaudoux jbaudoux force-pushed the oca-port-stock_available_to_promise_release-18.0-to-16.0-88bc39 branch from 5dcd97a to a0d940a Compare April 9, 2026 13:01
@jbaudoux jbaudoux changed the title [BKPORT][16.0] stock_available_to_promise_release: Backport fix/imp from 18.0 [16.0][FW] stock_available_to_promise_release: Backport fix/imp from 18.0 Apr 9, 2026
@jbaudoux jbaudoux added this to the 16.0 milestone Apr 9, 2026
@jbaudoux jbaudoux changed the title [16.0][FW] stock_available_to_promise_release: Backport fix/imp from 18.0 [16.0][FW] stock_available_to_promise_release: Backports from 18.0 Apr 9, 2026
Copy link
Copy Markdown

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

😲 🤔 😲 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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants