[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:
parent
9bae596693
commit
0cbf8d5386
|
@ -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,
|
||||
|
|
Loading…
Reference in New Issue