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

[13.0][MIG] stock_auto_move #735

Merged
merged 26 commits into from
Jul 5, 2021

Conversation

rousseldenis
Copy link
Contributor

No description provided.

npiganeau and others added 20 commits January 7, 2021 16:09
* The `_apply` method should not be overridden. In case of three step
operation with the last step set to auto move. The override of the
`_apply` method was causing the second move to be automatic as well.

**Use case**: doing a reception operation in two steps where the moves on
the second step are set to be automatic (using the push rule in this
case), and the reception is done partially.
**Expected Result**: When doing a first reception step partially a back
order is created, and we expect the second step to have a back order for
the remaining qty as well.
**Current behavior**: The correct move is processed automatically but no
backorder is created. The reason for that behavior is we processing the
move directly (i.e calling `action_done` of the `stock.move`) without
going through the normal process (i.e processing the second step
picking).
**The solution to the problem**: The processing the of the automatic
stock move should follow the same behavior as done from the user interface.
I've added a new function in `stock.picking` model called
`_transfer_pickings_with_auto_move` to simulate the same behavior this
function is called inside the `action_assign` of the stock move instead
of calling the `action_done` of the move.
As in v>=12, stock.location.path and procurement.rule have been merged
into stock.rule, use the same field name.
If moves were created with a particular procurment group, don't
change it to automatic one. Do it only if it's void.
As unit of measure can be a different multiple than reference,
use product_uom_qty instead.
If in a first picking, we transfer partially one quantity and
say 'No backorder', the destination move should be split and
cancelled for the remaining quantities if 'propagate_cancel'
is set.
@rousseldenis rousseldenis force-pushed the 13.0-mig-stock-auto-move-dro branch 2 times, most recently from 37573a2 to f47db59 Compare February 26, 2021 15:15
… (take2)

In case of partial flows with move cancel and mixed moves (auto and manual),
we need to create a backorder for manual quantities to not get a picking
with moves with mixed states (done, cancel, assigned).

We remove code that is never called on picking side
@hparfr
Copy link
Contributor

hparfr commented Jul 5, 2021

/ocabot merge nobump

@OCA-git-bot
Copy link
Contributor

What a great day to merge this nice PR. Let's do it!
Prepared branch 13.0-ocabot-merge-pr-735-by-hparfr-bump-nobump, awaiting test results.

@OCA-git-bot OCA-git-bot merged commit 994633b into OCA:13.0 Jul 5, 2021
@OCA-git-bot
Copy link
Contributor

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

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.

9 participants