[FIX] website_event: restore the online magic country

Removed with commit aebe199d80, but independant of is_online

Restore partially the feature, order by physical event is no more easy to restore
since is_online field doesn't exists anymore to sort.

Can be done as a custo if really required.

closes odoo/odoo#54516

X-original-commit: a6be8cfa40525c5d835cdb40e2e8936aeb36864c
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
This commit is contained in:
Jeremy Kersten
2020-07-15 13:16:39 +00:00
parent 59a156f80c
commit b3681bc85f
+3 -1
View File
@@ -100,9 +100,11 @@ class WebsiteEventController(http.Controller):
current_type = EventType.browse(int(searches['type']))
domain_search["type"] = [("event_type_id", "=", int(searches["type"]))]
if searches["country"] != 'all':
if searches["country"] != 'all' and searches["country"] != 'online':
current_country = request.env['res.country'].browse(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 = []