[FIX] website_crm_partner_assign: do not browse a recordset

search returns a recordset, not ids
In previous code `country.id` retuns the record, not the id.
This commit is contained in:
Martin Trigaux
2016-09-12 15:27:35 +02:00
parent 9f28139297
commit 64f0b217b4
@@ -183,9 +183,7 @@ class WebsiteCrmPartnerAssign(WebsitePartnerPage):
if not country and not country_all:
country_code = request.session['geoip'].get('country_code')
if country_code:
country_ids = country_obj.search([('code', '=', country_code)])
if country_ids:
country = country_obj.browse(country_ids[0])
country = country_obj.search([('code', '=', country_code)], limit=1)
if country:
grade_domain += [('country_id', '=', country.id)]
grades = partner_obj.sudo().read_group(