From 0cbf8d538604ebb81b85c4250d2548ff7c6fb056 Mon Sep 17 00:00:00 2001 From: Jeremy Kersten Date: Fri, 6 Feb 2015 10:49:57 +0100 Subject: [PATCH] [FIX] website_customer: check that customer has a country_id Add country != False in main domain will be not the right fix, because if people doesn't activate the sort by country in customize, they are no reason to hide customer without country_id. --- addons/website_customer/controllers/main.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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,