diff --git a/addons/website_customer/controllers/main.py b/addons/website_customer/controllers/main.py index 793d6067fb7..327a7a1c2ef 100644 --- a/addons/website_customer/controllers/main.py +++ b/addons/website_customer/controllers/main.py @@ -41,14 +41,14 @@ class WebsiteCustomer(http.Controller): if country_id: domain += [('country_id', '=', country_id)] - if not any(x['country_id'][0] == country_id for x in countries): + if not any(x['country_id'][0] == country_id for x in countries if x['country_id']): country = country_obj.read(cr, uid, country_id, ['name'], context) if country: countries.append({ 'country_id_count': 0, 'country_id': (country_id, country['name']) }) - countries.sort(key=lambda d: d['country_id'][1]) + countries.sort(key=lambda d: d['country_id'] and d['country_id'][1]) countries.insert(0, { 'country_id_count': country_count,