odoo/odoo#238933
Created by fw-bot
Statuses:
- legal/cla: Contributor License Agreement check
- ci/runbot: Odoo Test Suite
- ci/upgrade_enterprise: Test upgrades for enterprise master
- ci/template: Contact runbot team on discord for help.
- ci/style: Optional style check. Ignore it only if strictly necessary.
- ci/security: Required security check. Can only be ignored by security team.
- label
- odoo-dev:saas-18.4-17.0-opw-4806023-inventory-valuation-intricated-BoM-cohe-449254-fw
- head
- 0ffd77394993d8244b8ef9061d99e231518f0a32
- merged
- 1 week ago by Bugfix, Lancelot Semal (lase)
| odoo/odoo | |
|---|---|
| saas-18.3 | #218326 |
| saas-18.4 | #238933 |
| 19.0 | #240425 missing r+ |
| saas-19.1 | |
| master |
[FIX] purchase_mrp, mrp: correct BoM Kit valuation with nested kits
[FIX] purchase_mrp, mrp: correct BoM Kit valuation with nested kits
Issue:
When purchasing a BoM Kit (50/50) containing others BoM Kits (50/50), cost share was applied at each level (50% instead of 25%), leading to overvaluation (e.g., 200% total instead of 100%)
Cause:
cost_share was always applied fully during BoM explosion and as a portion of the full price on _get_unit_price()
Other bug fixed:
Fix _get_cost_share() to correctly return 0 when BoM total cost_share already equals 100%
Requirement:
AVCO (Average Cost) must be enabled on all components/BoMs
Steps to reproduce:
- Recreate that hierarchy with AVCO Products
- A kit "Testing Kit Complete" containing:
-- "Component01", cost share 50%
-- A kit "Testing Kit 1", cost share 50%:
--- "Component02", cost share 50%
--- "Component03", cost share 50% - Create and validate a Purchase Order for "Testing Kit Complete" (unit price: 1000)
- Receive the products
- Go in Inventory > Reporting > Valuation and search for Component
- All 3 components are set to 500, instead of Component01: 500 / Component02: 250/ Component03: 250
[FIX] purchase_mrp: correct BoM valuation with product variants or optional lines
Issue:
BoM valuation ignores variant-specific lines and does not skip lines with quantity 0
Cause:
The code only checks that the BoM adds up to 100%
But this can cause issues with variants that do not include all products or with optional lines
As a result, the total valuation may be incorrect
Steps to reproduce:
- Recreate a kit hierarchy with AVCO products:
- Kit "Variant Kit" (Variant Color: White and Wood) containing:
-- "Component01", cost share 0%, only for variant White
-- "Component02", cost share 0% - Create and confirm a Purchase Order for "Variant Kit" (variant: Wood, unit price: 1000)
- Receive the products
- Go to Inventory > Reporting > Valuation and search for the components
- Only Component02 appears with 500$, so only half of the total value is shown
Forward-Port-Of: #218326