[FIX] mrp: typo that prevent to force_company

The correct context key is force_company to retrieve the correct
standard_price (which has company_dependent=True)

Use case:
- Set standard price of C as 10 in company A
- Set standard price of C as 20 in company B
- Create a BoM with Final Product -> Sub component (company A)
- Create a BoM with Sub component -> C (company A)
- Connect as company B
- Open the bom structure and cost report

It will display the price of C as 20. However since the BoM is used by
company A it should use the price of company A (10)

closes odoo/odoo#90196

X-original-commit: 275103447381c95e59e281ce6569bcce38b51815
Signed-off-by: Arnold Moyaux <arm@odoo.com>
This commit is contained in:
Sylvain LE GAL
2022-04-29 18:22:17 +02:00
committed by Arnold Moyaux
parent 0b90ef9bba
commit efd615c2e2
@@ -258,7 +258,7 @@ class ReportBomStructure(models.AbstractModel):
else:
prod_qty = line.product_qty * factor / bom.product_qty
company = bom.company_id or self.env.company
not_rounded_price = line.product_id.uom_id._compute_price(line.product_id.with_context(force_comany=company.id).standard_price, line.product_uom_id) * prod_qty
not_rounded_price = line.product_id.uom_id._compute_price(line.product_id.with_company(company).standard_price, line.product_uom_id) * prod_qty
price += company.currency_id.round(not_rounded_price)
return price