[FIX] website_hr_recruitement: Don't use GeoIp if all countries is selected

This commit is contained in:
Jeremy Kersten 2014-09-16 11:29:14 +02:00
parent 2cbdd7ab0e
commit 0d0a6c37ba
2 changed files with 2 additions and 2 deletions

View 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)])

View File

@ -227,7 +227,7 @@
<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>