[FIX] correctly type date field in crm_lead_report
authorGéry Debongnie <ged@odoo.com>
Fri, 25 Jul 2014 13:52:38 +0000 (15:52 +0200)
committerOlivier Dony <odo@openerp.com>
Wed, 30 Jul 2014 13:11:22 +0000 (15:11 +0200)
opening_date and date_closed were cast to char but are supposed to be
dates.  When you try to group crm_lead_report by one of them, postgres
was not happy.  Now, it properly tells postgres that they are of type
date.

addons/crm/report/crm_lead_report.py

index 32851a7..2b46be9 100644 (file)
@@ -88,8 +88,8 @@ class crm_lead_report(osv.osv):
                     id,
                     c.date_deadline,
 
-                    to_char(c.date_open, 'YYYY-MM-DD') as opening_date,
-                    to_char(c.date_closed, 'YYYY-mm-dd') as date_closed,
+                    date(c.date_open) as opening_date,
+                    date(c.date_closed) as date_closed,
 
                     date_trunc('day',c.date_last_stage_update) as date_last_stage_update,