[FIX] im_livechat : fix rule matching according to the country code found with GeoIP

This commit is contained in:
Jérome Maes
2015-03-23 14:49:06 +01:00
parent e5e9e35c30
commit e36ffa8a55
+1 -1
View File
@@ -27,7 +27,7 @@ class LivechatController(http.Controller):
info["username"] = kwargs.get("username", "Visitor")
# find the country from the request
country_id = False
country_code = request.session.geoip and request.session.geoip.get('country_name') or False
country_code = request.session.geoip and request.session.geoip.get('country_code') or False
if country_code:
country_ids = registry.get('res.country').search(cr, uid, [('code', '=', country_code)], context=context)
if country_ids: