Skip to content
Snippets Groups Projects
Commit 9e86271a authored by FraB's avatar FraB Committed by Victor Feyens
Browse files

[FIX] product: empty company record given to currency conversion


The method `price_compute` on `product.product` model was wrongly
using the product `company_id` field as `company` for the currency
conversion call.

Indeed, products do not always have a company (they can be shared
across companies) and when they don't, `_convert` will fail, raising
an AssertionError as it expects a valid company record.

This commit makes sure the method will work as expected even for
products shared between companies, and harmonizes both `price_compute`
methods (on `product.product` & `product.template` models) by using
the given company (or the company of the environment) for the conversion
as we want the returned price to be computed for the given company,
not for the product company anyway.

closes odoo/odoo#117435

Signed-off-by: default avatarVictor Feyens (vfe) <vfe@odoo.com>
parent a0bd8159
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