[FIX] website_customer: error if customer without countries

For customer without countries, we get False instead of tuple:
 (country_id, 'country name')

Introduced by a35cce2008.

opw-703234
This commit is contained in:
Nicolas Lempereur
2016-12-30 15:27:48 +01:00
parent e1deead1cb
commit 5869cd6bd0
+1 -1
View File
@@ -51,7 +51,7 @@ class WebsiteCustomer(http.Controller):
if country_id:
domain += [('country_id', '=', country_id)]
curr_country = Country.browse(country_id)
if country_id not in map(lambda x: x['country_id'][0], countries):
if country_id not in (x['country_id'][0] for x in countries if x['country_id']):
if curr_country.exists():
countries.append({
'country_id_count': 0,