[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.
This commit is contained in:
Denis Ledoux 2014-10-21 10:13:44 +02:00
parent b00122ad99
commit 78a29b3738
1 changed files with 1 additions and 1 deletions

View File

@ -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,