From cb3c2e64c367c5b46bb8d4e253473c162e4dbaca Mon Sep 17 00:00:00 2001 From: Jorge Pinna Puissant Date: Mon, 12 Aug 2019 08:39:07 +0000 Subject: [FIX] partner_autocomplete, web: autocomplete error when suggested company has a country - Change the company's country to Finland; - Go to Contacts and click on Create; - Tick the Company box above the Name field; - Start typing into the Name field; - Click on a company with a VAT number under its name. Before this commit, a Traceback appears. This occurs because the response of the request with the suggested company has the fields 'company_name' and 'company_code' and these fields are not in res_partner. Now, the suggested company is parsed to correctly field the country field. opw-2049636 closes odoo/odoo#35631 Signed-off-by: Simon Goffin (sig) --- addons/partner_autocomplete/models/res_partner.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'addons/partner_autocomplete/models') diff --git a/addons/partner_autocomplete/models/res_partner.py b/addons/partner_autocomplete/models/res_partner.py index 16199d84e8c..3ea4014f657 100644 --- a/addons/partner_autocomplete/models/res_partner.py +++ b/addons/partner_autocomplete/models/res_partner.py @@ -110,7 +110,7 @@ class ResPartner(models.Model): if suggestions: results = [] for suggestion in suggestions: - results.append(suggestion) + results.append(self._format_data_company(suggestion)) return results else: return [] -- cgit v1.2.3