[FIX] website_hr_recruitement: Don't use GeoIp if all countries is selected
authorJeremy Kersten <jke@odoo.com>
Tue, 16 Sep 2014 09:29:14 +0000 (11:29 +0200)
committerJeremy Kersten <jke@odoo.com>
Tue, 16 Sep 2014 09:29:14 +0000 (11:29 +0200)
addons/website_hr_recruitment/controllers/main.py
addons/website_hr_recruitment/views/templates.xml

index 6da8697..112c314 100644 (file)
@@ -36,7 +36,7 @@ class website_hr_recruitment(http.Controller):
         countries = set(o.country_id for o in offices if o.country_id)
 
         # Default search by user country
-        if not (country or department or office_id):
+        if not (country or department or office_id or kwargs.get('all_countries')):
             country_code = request.session['geoip'].get('country_code')
             if country_code:
                 countries_ = Country.search([('code', '=', country_code)])
index 1695447..003369e 100644 (file)
 <template id="job_countries" inherit_id="website_hr_recruitment.index" active="False" customize_show="True" name="Filter by Countries">
     <xpath expr="//div[@id='jobs_grid_left']" position="inside">
         <ul class="nav nav-pills nav-stacked mb32">
-            <li t-att-class=" '' if country_id else 'active' "><a t-attf-href="/jobs#{ '/department/%s' % slug(department_id) if department_id else '' }#{ '/office/%s' % office_id if office_id else '' }?all_country=1">All Countries</a></li>
+            <li t-att-class=" '' if country_id else 'active' "><a t-attf-href="/jobs#{ '/department/%s' % slug(department_id) if department_id else '' }#{ '/office/%s' % office_id if office_id else '' }?all_countries=1">All Countries</a></li>
             <t t-foreach="countries" t-as="country">
                 <li t-att-class="'active' if country_id and country_id.id == country.id else ''">
                     <a t-attf-href="/jobs/country/#{ slug(country) }#{ '/department/%s' % slug(department_id) if department_id else '' }#{ '/office/%s' % office_id if office_id else '' }" ><span t-field="country.name"/></a>