[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.
This commit is contained in:
Jeremy Kersten 2015-02-06 10:49:57 +01:00
parent 9bae596693
commit 0cbf8d5386
1 changed files with 2 additions and 2 deletions

View File

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