From dee3b87ae4b7c67f21a445ed8caecdd6fa36277f Mon Sep 17 00:00:00 2001 From: Jeremy Kersten Date: Fri, 23 Feb 2018 10:09:33 +0100 Subject: [PATCH] [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 --- addons/website_customer/controllers/main.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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: