[FIX] website_event: display unconfirmed events too

This commit is contained in:
Denis Ledoux 2014-07-28 19:34:12 +02:00
parent eda2f064cf
commit 23436ca259
1 changed files with 2 additions and 2 deletions

View File

@ -245,9 +245,9 @@ class website_event(http.Controller):
result = {'events':[],'country':False}
if country_code:
country_ids = country_obj.search(request.cr, request.uid, [('code', '=', country_code)], context=request.context)
event_ids = event_obj.search(request.cr, request.uid, ['|', ('address_id', '=', None),('country_id.code', '=', country_code),('date_begin','>=', time.strftime('%Y-%m-%d 00:00:00')),('state', '=', 'confirm')], order="date_begin", context=request.context)
event_ids = event_obj.search(request.cr, request.uid, ['|', ('address_id', '=', None),('country_id.code', '=', country_code),('date_begin','>=', time.strftime('%Y-%m-%d 00:00:00'))], order="date_begin", context=request.context)
if not event_ids:
event_ids = event_obj.search(request.cr, request.uid, [('date_begin','>=', time.strftime('%Y-%m-%d 00:00:00')),('state', '=', 'confirm')], order="date_begin", context=request.context)
event_ids = event_obj.search(request.cr, request.uid, [('date_begin','>=', time.strftime('%Y-%m-%d 00:00:00'))], order="date_begin", context=request.context)
for event in event_obj.browse(request.cr, request.uid, event_ids, context=request.context)[:6]:
if country_code and event.country_id.code == country_code:
result['country'] = country_obj.browse(request.cr, request.uid, country_ids[0], context=request.context)