Djamel Touati e59f37999a [FIX] mrp: split the MO into the correct quantity
Steps to Reproduce the Bug:
- Create a BoM:
    - Product: P1, Quantity: 1 unit
    - Component:
        - C1, Quantity: 1 unit

- Create a MO to produce 10 units of P1:
    - This requires 10 units of C1
- In draft state, split the quantity into 10

**Problem:**
The created MOs have component quantities of 0.1 instead of 1.

When the MO is split, we update the product quantity of the original MO
to 1, which triggers the `_compute_move_raw_ids` because it depends on
the product_qty of the MO. Therefore, the move will be updated to 1.
https://github.com/odoo/odoo/blob/17.0/addons/mrp/models/mrp_production.py#L1793

Subsequently, the factor is calculated based on the `move_qty` and the
`qty_initial` of the MO.
https://github.com/odoo/odoo/blob/17.0/addons/mrp/models/mrp_production.py#L1828

Factor = 1 / 10 = 0.1

Afterwards, this quantity is set on the original move and the backorder
moves:
https://github.com/odoo/odoo/blob/17.0/addons/mrp/models/mrp_production.py#L1830
https://github.com/odoo/odoo/blob/17.0/addons/mrp/models/mrp_production.py#L1835

opw-3825708

closes odoo/odoo#159713

X-original-commit: 10554f3a3e28374c460a475a4908015aeb8a81cc
Signed-off-by: William Henrotin (whe) <whe@odoo.com>
Signed-off-by: Djamel Touati (otd) <otd@odoo.com>
2024-03-29 09:12:21 +00: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%