From b3681bc85f44e68c46bee31fcadf8d9850029d4a Mon Sep 17 00:00:00 2001 From: Jeremy Kersten Date: Wed, 15 Jul 2020 11:31:33 +0000 Subject: [PATCH] [FIX] website_event: restore the online magic country Removed with commit aebe199d80c5c7411c3db44386c7b9f3cc5b712d, 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) --- addons/website_event/controllers/main.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/addons/website_event/controllers/main.py b/addons/website_event/controllers/main.py index f0c5351801f..4dff7fdd61d 100644 --- a/addons/website_event/controllers/main.py +++ b/addons/website_event/controllers/main.py @@ -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 = []