[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:
@@ -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(
|
||||
|
||||
Reference in New Issue
Block a user