Files
odoo_source/addons/purchase_mrp/models
Touati Djamel (otd) 222d38ad01 [FIX] purchase_stock, purchase_mrp: adjust the qty of purchased kit correctly
Steps to reproduce the bug:
- Create a BOM kit for “product K”  with:
    - 2 * “product A”
    - 1 * “product B”
- Create a PO for 1 unit of “product K” > confirm
- A receipt delivery with 2 units of “product A” and 1 unit of B will be created
- Modify the ordered Qty to 2 units of “Product K”

Problem:
The receipt delivery will not be updated correctly (4 units of product A and 3 of product B)
because the `"_prepare_stock_moves"` function computed the previous quantity wrong based on the moves quantities
since the moves are for products A and B, not product F.(do not take into account the products in kit)

Solution:
For kit products, do not calculate from the `"stock.move"`, calculate the difference between the quantity before and after the change

opw-2645719

closes odoo/odoo#77838

Signed-off-by: Arnold Moyaux <amoyaux@users.noreply.github.com>
2021-10-05 14:16:58 +00:00
..