summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLucas Perais (lpe) <lpe@odoo.com>2018-10-12 11:17:40 +0200
committerLucas Perais (lpe) <lpe@odoo.com>2018-10-15 09:24:20 +0200
commit8fb61cd8305e2e5c580c4060068cbb7ddc683d70 (patch)
tree87a05f2e67a48aa01fe5e531ca97df21587cc1ce
parent0b414cb8145381cd8a3946aae9cec1601b111238 (diff)
[FIX] product_margin: sales and purchase in invoice's currency
Invoice price should be adapted to the invoice currency Before this commit, it was not. OPW 1889997 closes #27710
-rw-r--r--addons/product_margin/models/product_product.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/addons/product_margin/models/product_product.py b/addons/product_margin/models/product_product.py
index 8911e3bc716..dda0a0ef2dd 100644
--- a/addons/product_margin/models/product_product.py
+++ b/addons/product_margin/models/product_product.py
@@ -106,7 +106,7 @@ class ProductProduct(models.Model):
select
sum(l.price_unit * l.quantity)/nullif(sum(l.quantity),0) as avg_unit_price,
sum(l.quantity) as num_qty,
- sum(l.quantity * (l.price_subtotal/(nullif(l.quantity,0)))) as total,
+ sum(l.quantity * (l.price_subtotal_signed/(nullif(l.quantity,0)))) as total,
sum(l.quantity * pt.list_price) as sale_expected
from account_invoice_line l
left join account_invoice i on (l.invoice_id = i.id)