summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVidhin Mehta (OpenERP) <vme@tinyerp.com>2014-03-14 17:53:03 +0530
committerVidhin Mehta (OpenERP) <vme@tinyerp.com>2014-03-14 17:53:03 +0530
commitcfa67eeacec07849639aed47606fab3efabe857b (patch)
treef8170b7fbafcc690a6500b17af1b1dc0e15e81c9
parent54fd56bd7dc86d5364246d2990f4b1332e2dd281 (diff)
[IMP]Filter records in which start date and duration are null also duration is 0.
bzr revid: vme@tinyerp.com-20140314122303-q7hgy4a3ij91yfxu
-rw-r--r--addons/website_event_track/controllers/event.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/addons/website_event_track/controllers/event.py b/addons/website_event_track/controllers/event.py
index c470967928f..ccb8bd0daaf 100644
--- a/addons/website_event_track/controllers/event.py
+++ b/addons/website_event_track/controllers/event.py
@@ -105,17 +105,19 @@ class website_event(http.Controller):
request.cr.execute('''
Select id, location_id, groupby_datetime, duration, name, date from (
- Select id, location_id, to_char(date_trunc('hour',date),'mm-dd-yy hh AM') as
+ Select id, location_id, to_char(date_trunc('hour',date),'mm-dd-yy hh AM') as
groupby_datetime, duration, name, event_id, date, count(*) as tot from event_track
+ where date IS NOT NULL AND duration IS NOT NULL AND duration != 0
group by event_id, duration, id, location_id, date, date_trunc('hour',date)
order by date, date_trunc('hour',date)
)
- event_query where event_query.event_id = %s
+ event_query where event_query.event_id = %s
group by event_query.location_id, event_query.id,
event_query.groupby_datetime, event_query.duration,event_query.name, event_query.date;
''',(event.id,))
fetch_tracks = request.cr.fetchall()
+ print "vvvv",fetch_tracks
request.cr.execute('''
select count(*), date_trunc('day',date) from event_track where event_id = %s group by date_trunc('day',date) order by date_trunc('day',date)