Skip to content
Snippets Groups Projects
Commit eee68d23 authored by MerlinGuillaume's avatar MerlinGuillaume
Browse files

[FIX] mrp: recursive BoM cost correctly computed

On recursive BoM with more than 3 nested levels, the cost of the child
bom is wrong resulting in a wrong total

Steps to reproduce:
1. Install Manufacturing
2. Create products C1 (with cost 5€), P1, P2, P3
3. Create BoM for 2 units of P1 with 1 unit of C1 as component
4. Create BoM for 1 unit of P2 with 1 unit of P1 as component
5. Create BoM for 1 unit of P3 with 1 unit of P2 as component
6. Go to the BoM of P3 and open 'BoM Structure & Cost'
7. BoM cost of P3 is 1.25€, it should be 2.5€

Solution:
The quantity used to compute the price of a child bom should not be
divided by the child bom quantity

Problem:
When `_get_price` calls itself (with a child bom), the factor passed is
wrongly divided by `line.child_bom_id.product_uom_qty` because the
quantity used to compute the price of a component is already divided by
`bom.product_qty`
https://github.com/odoo/odoo/blob/eaf5618dc416a4565e084316595da4a0d8377acc/addons/mrp/report/mrp_report_bom_structure.py#L207



opw-3007792
opw-2990445

closes odoo/odoo#103796

Signed-off-by: default avatarAdrien Widart <awt@odoo.com>
parent ca1793d3
Branches
Tags
No related merge requests found
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment