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

[14.0][MIG] - stock_auto_move #852

Merged
merged 27 commits into from
Jul 5, 2021
Merged

Conversation

sbejaoui
Copy link
Contributor

FW #735

npiganeau and others added 26 commits June 10, 2021 11:18
* 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.
… (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
@sbejaoui
Copy link
Contributor Author

cc/ @rousseldenis

@rousseldenis rousseldenis added this to the 14.0 milestone Jun 11, 2021
@rousseldenis rousseldenis mentioned this pull request Jun 11, 2021
57 tasks
Copy link
Contributor

@rousseldenis rousseldenis left a comment

Choose a reason for hiding this comment

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

Code review

Copy link
Contributor

@hparfr hparfr left a comment

Choose a reason for hiding this comment

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

LGTM

@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 14.0-ocabot-merge-pr-852-by-hparfr-bump-nobump, awaiting test results.

@OCA-git-bot
Copy link
Contributor

This PR has the approved label and has been created more than 5 days ago. It should therefore be ready to merge by a maintainer (or a PSC member if the concerned addon has no declared maintainer). 🤖

@OCA-git-bot OCA-git-bot merged commit 19534d3 into OCA:14.0 Jul 5, 2021
@OCA-git-bot
Copy link
Contributor

Congratulations, your PR was merged at eb28775. 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.

8 participants