Touati Djamel (otd) 6ad32b2732 [FIX] sale_mrp: decrease kit quantity to 0 after so confirmation
Steps to reproduce the bug:
- Create two storable products:
    - kit_1 and Comp_1
- Create a bill of materials:
    - Product: kit_1
    - Type: Kit
    - Components: 1 unit of Comp_1
- Create a SO with:
    - kit: 1 unit
    - Confirm the SO
- A picking with 2 units of “comp_1” will be created

- Edit SO:
    - Reduce the qty of kit_1 to 0

Problem:
“Comp_1” qty not updated to 0 on the picking.

When the SOL qty is updated, the pickings should be updated too.
So we get the qty in delivery:
https://github.com/odoo/odoo/blob/e11dfa341baf82fedee753502aef5ef2972f75cb/addons/sale_stock/models/sale_order.py#L553

then the difference between that qty and the new SOL qty is computed.
And procurement based on that difference is created:
https://github.com/odoo/odoo/blob/e11dfa341baf82fedee753502aef5ef2972f75cb/addons/sale_stock/models/sale_order.py#L573-L578

but the `_get_qty_procurement` function returns 0 as result, because
the `_compute_kit_quantities` function is called with the qty set on
the SO (“0”), so the result will be 0 because we need 0 qty to have 0
kit:
https://github.com/odoo/odoo/blob/4ee5df76607c80c94a4aea832dcd2f73ad8e5ee1/addons/sale_mrp/models/sale_order_line.py#L121-L122

opw-3018258

closes odoo/odoo#105078

X-original-commit: 8fcbd91b4416f08693bc806c5f99c6c429ecfe66
Signed-off-by: Djamel Touati (otd) <otd@odoo.com>
Signed-off-by: William Henrotin (whe) <whe@odoo.com>
2022-11-07 09:12:14 +01:00
2022-10-06 14:56:52 +02:00
…
2015-09-08 17:58:38 +02:00

Build Status Tech Doc Help Nightly Builds

Odoo

Odoo is a suite of web based open source business apps.

The main Odoo Apps include an Open Source CRM, Website Builder, eCommerce, Warehouse Management, Project Management, Billing & Accounting, Point of Sale, Human Resources, Marketing, Manufacturing, ...

Odoo Apps can be used as stand-alone applications, but they also integrate seamlessly so you get a full-featured Open Source ERP when you install several Apps.

Getting started with Odoo

For a standard installation please follow the Setup instructions from the documentation.

To learn the software, we recommend the Odoo eLearning, or Scale-up, the business game. Developers can start with the developer tutorials

S
Description
No description provided
Readme LGPL-3.0
3.4 GiB
Languages
Python 49.6%
JavaScript 47.8%
SCSS 2%
CSS 0.3%
HTML 0.2%