Skip to content
Snippets Groups Projects
Commit 4180afb9 authored by Adrien Widart (awt)'s avatar Adrien Widart (awt)
Browse files

[FIX] {sale_,}stock: decrease SOL qty with existing backorders


2-steps delivery. If there is already a backorder for the picking
out->customer, when decreasing the SOL qty, an unexpected picking
will be created

To reproduce the error:
1. In Settings, enable "Multi-Step Routes"
2. Edit the warehouse:
   - Outgoing: 2 steps
3. Create a storable product P
4. Update the on hand qty:
   - 10 x P at WH/Stock
5. Create and confirm a SO with 10 x P
6. Process the pickings with 6 x P (with backorders)
   - There should be 4 pickings
7. On the SO, decrease the quantity to 7

Error: an unexpected picking (customer -> out) is created for 3 x P

Step 6, when creating a backorder for 4 x P from out to customer,
we split the initial SM, and we force the `procure_method` to
`make_to_stock`
Step 7, when decreasing the qty, we create a negative procurement
and run the rules' system. Because of warehouse configuration, the
rule that links output location and customer one is based on an MTO
logic: the SM for -3 x P has the `procure_method` set to
`make_to_order`. As a result, that move will not be merged with the
one created during the split (step 6) and we will create the
unexpected picking for the move.

The SM generated by the split should keep the same procure method
logic as the initial one.

OPW-3141387

closes odoo/odoo#114686

Signed-off-by: default avatarWilliam Henrotin (whe) <whe@odoo.com>
parent f7030ad4
Branches
Tags
No related merge requests found
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment