summaryrefslogtreecommitdiff
path: root/addons
diff options
context:
space:
mode:
authorDenis Ledoux <dle@openerp.com>2014-01-30 17:36:39 +0100
committerDenis Ledoux <dle@openerp.com>2014-01-30 17:36:39 +0100
commitba09b1d4391cbfc3a931f00217a9de77a37823ca (patch)
tree1b658c82211038e6d4f5ccf31dbc228ced7a1a20 /addons
parent6dca5f8f1ce714c443cb9895266b4076ff5cf418 (diff)
[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
Diffstat (limited to 'addons')
-rw-r--r--addons/website_customer/controllers/main.py6
-rw-r--r--addons/website_customer/views/website_customer.xml2
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 @@
<t t-foreach="countries" t-as="country_dict">
<t t-if="country_dict['country_id']">
<li t-att-class="country_dict['country_id'][0] == current_country_id and 'active' or ''">
- <a t-attf-href="/customers/#{ country_dict['country_id'][0] and 'country/%s/' % slug(country_dict['country_id']) or '' }">
+ <a t-attf-href="/customers/#{ country_dict['country_id'][0] and 'country/%s/' % slug(country_dict['country_id']) or '' }#{ search_path }">
<span class="badge pull-right" t-esc="country_dict['country_id_count'] or ''"/>
<t t-esc="country_dict['country_id'][1]"/>
</a>