-
- Downloads
[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:
Victor Feyens (vfe) <vfe@odoo.com>
Loading