diff options
| author | Olivier Dony <odo@openerp.com> | 2014-08-01 13:06:49 +0200 |
|---|---|---|
| committer | Olivier Dony <odo@openerp.com> | 2014-08-01 13:06:49 +0200 |
| commit | ee4df1e397a7f1ada09f53c3b72d9dddfa9b3e22 (patch) | |
| tree | 438b018b377a0c94be1d19e4c3928974b9d18f08 /addons/website_customer | |
| parent | 5ddc0305cd0bef77632ee50fb19ae7372ae5cb68 (diff) | |
| parent | 8b15482e0037b2484e993ffaf9e5691662c99e28 (diff) | |
[MERGE] Forward-port saas-4 up to 8b15482
Diffstat (limited to 'addons/website_customer')
| -rw-r--r-- | addons/website_customer/controllers/main.py | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/addons/website_customer/controllers/main.py b/addons/website_customer/controllers/main.py index fcb2d0d8ded..d4b996a0ab6 100644 --- a/addons/website_customer/controllers/main.py +++ b/addons/website_customer/controllers/main.py @@ -42,11 +42,12 @@ 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): - country = country_obj.browse(cr, uid, country_id, context) - countries.append({ - 'country_id_count': 0, - 'country_id': (country_id, country.name) - }) + 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.insert(0, { |
