Harmonize currency conversion of unit prices:
* Make sure no rounding is applied during the conversion
(it'll be managed by the price_unit decimal precision
and the currency rounding will only be applied by the
monetary fields later in the computations).
* consistent parameters for the conversion (date,
company, currency).
* code simplification
* consistent behavior when the SO has no currency specified
...
Part-of: odoo/odoo#110833
Purpose: When re-invoicing the expense on the SO, the cost (purchase_price)
is not correctly set. For expenses with zero product it is set to zero,
and for the expenses with price on it, it is set to unit_price of the product.
As a result, the margin is calculated incorrectly on SO.
It should be set to the untaxed_amount of the expense in case of zero
product, or untaxed_amount of the product in case of a product with
price defined on it.
task - 2867723
closesodoo/odoo#96981
Signed-off-by: Kevin Baptiste <kba@odoo.com>