Open grey27 opened 4 years ago
Impacted versions:13.0
my standard currency is CNY I set the cost of a product to 50 CNY
when I set up a price list in USD I set this product as 5 USD on the sale lines The calculated gross profit is -45 USD
odoo\addons\sale_margin\models\sale_order.py
@api.depends('product_id', 'purchase_price', 'product_uom_qty', 'price_unit', 'price_subtotal') def _product_margin(self): for line in self: currency = line.order_id.pricelist_id.currency_id price = line.purchase_price margin = line.price_subtotal - (price * line.product_uom_qty) line.margin = currency.round(margin) if currency else margin
the reason I found is that there is no exchange rate conversion when calculating gross profit in this method
maybe you should
price = line.purchase_price * currency.rate
Not sure but It is talking about https://github.com/odoo/odoo/issues/52562 ? (About missing calculation of Multi-currency)
AFAIK, the margin is expressed in the quotation currency.
Impacted versions:13.0
my standard currency is CNY I set the cost of a product to 50 CNY
when I set up a price list in USD I set this product as 5 USD on the sale lines The calculated gross profit is -45 USD
odoo\addons\sale_margin\models\sale_order.py
the reason I found is that there is no exchange rate conversion when calculating gross profit in this method
maybe you should