From ba09b1d4391cbfc3a931f00217a9de77a37823ca Mon Sep 17 00:00:00 2001 From: Denis Ledoux Date: Thu, 30 Jan 2014 17:36:39 +0100 Subject: [PATCH] [FIX] website_customer: keep search even if we change the country, list of country display all countries where there is at least one matching result bzr revid: dle@openerp.com-20140130163639-5z0pt5npgk0t3u8k --- addons/website_customer/controllers/main.py | 6 +++--- addons/website_customer/views/website_customer.xml | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/addons/website_customer/controllers/main.py b/addons/website_customer/controllers/main.py index 921e88141f1..9e026c135a2 100644 --- a/addons/website_customer/controllers/main.py +++ b/addons/website_customer/controllers/main.py @@ -34,9 +34,6 @@ class WebsiteCustomer(http.Controller): ('website_description', 'ilike', post.get("search")) ] - if country_id: - domain += [('country_id', '=', country_id)] - # group by country, based on customers found with the search(domain) countries = partner_obj.read_group( cr, openerp.SUPERUSER_ID, domain, ["id", "country_id"], @@ -48,6 +45,9 @@ class WebsiteCustomer(http.Controller): 'country_id': (0, _("All Countries")) }) + if country_id: + domain += [('country_id', '=', country_id)] + # search customers to display partner_ids = partner_obj.search(cr, openerp.SUPERUSER_ID, domain, context=request.context) google_map_partner_ids = ",".join([str(p) for p in partner_ids]) diff --git a/addons/website_customer/views/website_customer.xml b/addons/website_customer/views/website_customer.xml index e5b8cc44ecd..97b6fa29f80 100644 --- a/addons/website_customer/views/website_customer.xml +++ b/addons/website_customer/views/website_customer.xml @@ -81,7 +81,7 @@
  • - +