odoo/odoo#158166

Created by Mattis Megevand (mmeg)
label
odoo-dev:15.0-opw-3759006-stock_move_quantity_miscalculation-mmeg
head
136657fc335aa758982a6dc91977cebc8cdc6fea
target
15.0
merged
1 month ago by Logistics, William Henrotin (whe)
forward-ports

[FIX] mrp,stock: compute correct quantity for stock move

Steps to reproduce:
- Install MRP
- Enable packages and multi-step routes
- Enable two steps manufacturing
- Create a component and a product
- Create a BOM for the product and add the component
- Make an MO for 100 units of the product
- Go to the picking and make a move of 20 units of the component with a
destination package
- Put in pack
- Create the backorder and validate the transfer of the remaining
components
- Go back to the MO

Issues:
Units reserved is wrong. The problem is when we are unpacking, we were
using result package inside the key. But what we want is to remove
quantity from the package the quantity originate from.

opw-3759006