summaryrefslogtreecommitdiff
path: root/addons/product_margin/models
diff options
context:
space:
mode:
authorChristophe Simonis <chs@odoo.com>2017-06-06 17:28:59 +0200
committerChristophe Simonis <chs@odoo.com>2017-06-06 17:28:59 +0200
commit460cb3ba9ef3df417f5313d9d9070030acf4a579 (patch)
treedd3a88aa0c716542cd9b7ba61b92322776269249 /addons/product_margin/models
parentebc23b594a73f2287694f1ff0ebff42d285617f8 (diff)
parent7d7a45a921c0489f44993cc1897c5b83c47c3e67 (diff)
[MERGE] forward port branch saas-11 up to 7d7a45a921c
Diffstat (limited to 'addons/product_margin/models')
-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 fa65e79b38e..8911e3bc716 100644
--- a/addons/product_margin/models/product_product.py
+++ b/addons/product_margin/models/product_product.py
@@ -104,7 +104,7 @@ class ProductProduct(models.Model):
#Cost price is calculated afterwards as it is a property
sqlstr = """
select
- sum(l.price_unit * l.quantity)/sum(nullif(l.quantity,0)) as avg_unit_price,
+ 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 * pt.list_price) as sale_expected