[FIX] website_event: show online in event in all country. Add filter online event...
authorJeremy Kersten <jke@odoo.com>
Mon, 11 Aug 2014 15:15:57 +0000 (17:15 +0200)
committerJeremy Kersten <jke@odoo.com>
Mon, 11 Aug 2014 15:15:57 +0000 (17:15 +0200)
addons/website_event/controllers/main.py
addons/website_event/views/website_event.xml

index 2a6e1d1..2ceac51 100644 (file)
@@ -90,9 +90,12 @@ class website_event(http.Controller):
         if searches["type"] != 'all':
             current_type = type_obj.browse(cr, uid, int(searches['type']), context=context)
             domain_search["type"] = [("type", "=", int(searches["type"]))]
-        if searches["country"] != 'all':
+
+        if searches["country"] != 'all' and searches["country"] != 'online':
             current_country = country_obj.browse(cr, uid, int(searches['country']), context=context)
-            domain_search["country"] = [("country_id", "=", int(searches["country"]))]
+            domain_search["country"] = ['|', ("country_id", "=", int(searches["country"])), ("country_id", "=", False)]
+        elif searches["country"] == 'online':
+            domain_search["country"] = [("country_id", "=", False)]
 
         def dom_without(without):
             domain = [('state', "in", ['draft','confirm','done'])]
index 6c26ce3..4058ccc 100644 (file)
@@ -58,6 +58,7 @@
                             <div class="media-body">
                                 <h4 class="media-heading">
                                     <a t-att-class="event.state == 'done' and 'text-success'" t-attf-href="/event/#{ slug(event) }/#{(not event.menu_id) and 'register/' or ''}"><span t-field="event.name"> </span></a>
+                                    <small t-if="not event.address_id" class="label label-info">Online</small>
                                     <small t-if="not event.website_published" class="label label-danger">not published</small>
                                 </h4>
                                 <div>
         <ul class="nav nav-pills nav-stacked mt32">
             <t t-foreach="countries">
                 <li t-if="country_id" t-att-class="searches.get('country') == str(country_id and country_id[0]) and 'active' or ''">
-                    <a t-attf-href="/event/?{{ keep_query('type', 'data', country=country_id[0]) }}"><t t-esc="country_id[1]"/>
+                    <a t-attf-href="/event/?{{ keep_query('type', 'date', country=country_id[0]) }}"><t t-esc="country_id[1]"/>
+                        <span class="badge pull-right"><t t-esc="country_id_count"/></span>
+                    </a>
+                </li>
+                <li t-if="not country_id" t-att-class="searches.get('country') == 'online' and 'active' or ''">
+                    <a t-attf-href="/event/?{{ keep_query('type', 'date', country='online') }}">
+                        <span>Online Events</span>
                         <span class="badge pull-right"><t t-esc="country_id_count"/></span>
                     </a>
                 </li>