summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicolas Martinelli <nim@odoo.com>2017-02-07 16:56:33 +0100
committerNicolas Martinelli <nim@odoo.com>2017-02-07 17:29:44 +0100
commitbc2f8f9a40593b3fe8f908590a4762d66e5d1c19 (patch)
tree5043a749936fc7eca908f731aa6e1a8b5d9b3292
parent88af7c939269c8decd94a01c7ef2b95b0cd4a892 (diff)
[FIX] stock_account: missing forward-port
Missing forward-port of commit 5e466d3507d81d opw-707168
-rw-r--r--addons/stock_account/report/stock_history.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/addons/stock_account/report/stock_history.py b/addons/stock_account/report/stock_history.py
index 3e67dd1db8d..ccf150954dc 100644
--- a/addons/stock_account/report/stock_history.py
+++ b/addons/stock_account/report/stock_history.py
@@ -79,7 +79,7 @@ class StockHistory(models.Model):
product_template_id,
SUM(quantity) as quantity,
date,
- SUM(price_unit_on_quant * quantity) / SUM(quantity) as price_unit_on_quant,
+ COALESCE(SUM(price_unit_on_quant * quantity) / NULLIF(SUM(quantity), 0), 0) as price_unit_on_quant,
source,
string_agg(DISTINCT serial_number, ', ' ORDER BY serial_number) AS serial_number
FROM