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

[16.0] stock_available_to_promise_release: Migration to 16.0 #475

Merged

Conversation

lmignon
Copy link
Contributor

@lmignon lmignon commented Oct 28, 2022

No description provided.

guewen and others added 30 commits October 27, 2022 13:39
When:
* using a 3 steps delivery
* creating and confirming a sale order
* opening the transfer using the "Deliveries" button on the sale order
* clicking on the "Release" button

The pickings generated by the release are incorrect.
This is because the smart button of the sale order view adds several
"default_" fields that are then interpreted during the creation of the
chained pickings.

Clean these fields from the context.
When stock moves have been released, their 'need_release' flag must be
set to False. Due to a coding mistake, they were not. The most visible
effect was the "Release" button still visible on transfers and moves,
but other vicious effects can't be excluded.

The issue come from an inversion in the order of the list comprehension,
added up to the fact that the 'procurement' variable name was recycled
from the code above: 'procurement' was always equal to the latest
procurement used in the loop before the list comprehension.
To reproduce

* Order 100x [E-COM10]
* Update quantities in stock to have 70 [E-COM10] in Stock/Shelf 1
* Release the moves

Actual result:

2 transfer, the backorder for the waiting 30 [E-COM10] has no backorder
link with the original transfer

Expected result:

2 transfer, the backorder for the waiting 30 [E-COM10] has a backorder
link with the original transfer
Current behavior:

When we release an OUT stock move, the OUT transfer is set to printed.
The origin transfers (e.g. Pick+Pack) are not.

Expected behavior:

When we release an OUT stock move, all the origin transfer (e.g.
Pick+Pack) are set to printed.

Reason:

The original reason for setting "printed" to True, is that when
"_assign_picking()" is called on a stock.move, the stock.move can be
added only in a stock.picking which is not printed yet. In other terms,
"printed" means the transfer has been started and shouldn't be modified.
When we "release" moves, we actually planify the work to be done, and if
we release again new moves, we don't expect transfers of the 2 waves of
releases to be merged together.

If we set the flag "printed" on the Out transfer only, we can end up
with one Packing transfer leading to 2 Out transfers, which generally
doesn't make sense.
TDu and others added 6 commits October 27, 2022 13:39
The management of priorities on stock moves and stock picking has changed
between on v14 see

* odoo/odoo@e405537

This make the priority field that was nicely flowing between stock move
through the procurement values, not working any more.

That change on Odoo core omits the inverse function on the priority
field in stock move, but it would not help when going through the
procurement mechanism, because moves are created before they are
assigned to picking.
In 13.0 the field used on 'stock.move' was `date_expected` which has
been merged into `date` field in 14.0:

odoo/odoo@57f805f

This addon has been updated during the 14.0 migration to use `date_deadline`
by mistake.
To integrate routing flows with the release of operations.
This applies the routing flow on the move when this one is released
(when confirmed the flow is not applied anymore).
@lmignon lmignon force-pushed the 16.0-mig-stock_available_to_promise_release branch from 978adaa to c52ff7d Compare October 28, 2022 12:06
@lmignon
Copy link
Contributor Author

lmignon commented Oct 28, 2022

ping @jbaudoux @rousseldenis @simahawk

Copy link
Contributor

@sebalix sebalix left a comment

Choose a reason for hiding this comment

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

LG, minor comments

@sebalix
Copy link
Contributor

sebalix commented Nov 3, 2022

/ocabot migration stock_available_to_promise_release

@OCA-git-bot OCA-git-bot added this to the 16.0 milestone Nov 3, 2022
@OCA-git-bot OCA-git-bot mentioned this pull request Nov 3, 2022
17 tasks
@lmignon lmignon force-pushed the 16.0-mig-stock_available_to_promise_release branch from e99e8c5 to d66ae0a Compare November 4, 2022 07:31
.oca-port.json Outdated Show resolved Hide resolved
@lmignon lmignon force-pushed the 16.0-mig-stock_available_to_promise_release branch from d66ae0a to 7e8cec1 Compare November 7, 2022 09:34
@lmignon
Copy link
Contributor Author

lmignon commented Nov 7, 2022

@sebalix All comments taken into account.

@sebalix
Copy link
Contributor

sebalix commented Nov 7, 2022

/ocabot merge nobump

@OCA-git-bot
Copy link
Contributor

On my way to merge this fine PR!
Prepared branch 16.0-ocabot-merge-pr-475-by-sebalix-bump-nobump, awaiting test results.

@OCA-git-bot OCA-git-bot merged commit 743e7fe into OCA:16.0 Nov 7, 2022
@OCA-git-bot
Copy link
Contributor

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

@lmignon lmignon deleted the 16.0-mig-stock_available_to_promise_release branch November 7, 2022 10:29
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.