Skip to content
Switch branches/tags

Latest commit

When returning a kit, the margin of the related SO decreases

To reproduce the issue:
(Need sale_management)
1. In Settings, enable "Margins"
2. Create a Product Category PC:
    - Costing Method: FIFO
3. Create two products P_kit, P_compo:
    - Both:
        - Type: Storable
        - Category: PC
    - P_compo:
        - Cost: 10
4. Update P_compo quantity: 1
5. Create a BoM:
    - Product: P_kit
    - Type: Kit
    - Components: 1 x P_compo
6. Update P_kit's cost
7. Create and confirm a SO with 1 x P_kit, unit price = $100
    - Note that the margin is correct: $90
8. Process the related picking
9. Create a return R
10. Go back to the SO

Error: the margin is now $80

When computing the cost of the kit, the move linked to R are considered.
Therefore, the cost becomes $20 and thus the margin becomes $80


closes #82981

X-original-commit: 7a5a7c4
Signed-off-by: Arnold Moyaux <>
Signed-off-by: Adrien Widart <>


Failed to load latest commit information.

Build Status Tech Doc Help Nightly Builds


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