diff options
| author | Jeremy Kersten <jke@odoo.com> | 2018-02-23 10:09:33 +0100 |
|---|---|---|
| committer | Jeremy Kersten <jke@odoo.com> | 2018-02-23 10:36:15 +0100 |
| commit | dee3b87ae4b7c67f21a445ed8caecdd6fa36277f (patch) | |
| tree | 91c56d83d08dbc67a6072d8f410db9eb3ae1832c /addons/website_customer/controllers/main.py | |
| parent | ff7efbb1e81cd6987601c03f0b75a37d2df8e331 (diff) | |
[FIX] website_customer: fix sitemap when customer had no country
Before this commit, the sitemap will crash if you have some res.partner
without country that are publish and with an assigned_partner_id.
Now, we only search for customer with country that are set and avoid to have
a traceback:
File "/home/odoo/src/odoo/11.0/addons/website_customer/controllers/main.py", line 31, in sitemap_industry
loc = '/customers/country/%s' % slug(country['country_id'])
File "/home/odoo/src/odoo/11.0/addons/http_routing/models/ir_http.py", line 91, in slug
identifier, name = value
TypeError: 'bool' object is not iterable
Diffstat (limited to 'addons/website_customer/controllers/main.py')
| -rw-r--r-- | addons/website_customer/controllers/main.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/addons/website_customer/controllers/main.py b/addons/website_customer/controllers/main.py index 421a809b36d..063d4b9bb5f 100644 --- a/addons/website_customer/controllers/main.py +++ b/addons/website_customer/controllers/main.py @@ -24,7 +24,7 @@ class WebsiteCustomer(http.Controller): if not qs or qs.lower() in loc: yield {'loc': loc} - dom = [('website_published', '=', True), ('assigned_partner_id', '!=', False)] + dom = [('website_published', '=', True), ('assigned_partner_id', '!=', False), ('country_id', '!=', False)] dom += sitemap_qs2dom(qs, '/customers/country') countries = env['res.partner'].sudo().read_group(dom, ['id', 'country_id'], groupby='country_id') for country in countries: |
