From 78a29b3738c14ccc8b042de1d95f502e4bc282ef Mon Sep 17 00:00:00 2001 From: Denis Ledoux Date: Tue, 21 Oct 2014 10:13:44 +0200 Subject: [PATCH] [FIX] point_of_sale: no need to specify numeric digits In the report pos order, average_price was set as a numeric(16,2), therefore, if the amount was too big, it led to a psql crash: A field with precision 16, scale 2 must round to an absolute value less than 10^14. --- addons/point_of_sale/report/pos_order_report.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/point_of_sale/report/pos_order_report.py b/addons/point_of_sale/report/pos_order_report.py index f0b9c1e56c6..1f053a052c3 100644 --- a/addons/point_of_sale/report/pos_order_report.py +++ b/addons/point_of_sale/report/pos_order_report.py @@ -61,7 +61,7 @@ class pos_order_report(osv.osv): sum(l.qty * u.factor) as product_qty, sum(l.qty * l.price_unit) as price_total, sum((l.qty * l.price_unit) * (l.discount / 100)) as total_discount, - (sum(l.qty*l.price_unit)/sum(l.qty * u.factor))::decimal(16,2) as average_price, + (sum(l.qty*l.price_unit)/sum(l.qty * u.factor))::decimal as average_price, sum(cast(to_char(date_trunc('day',s.date_order) - date_trunc('day',s.create_date),'DD') as int)) as delay_validation, to_char(s.date_order, 'YYYY') as year, to_char(s.date_order, 'MM') as month,