diff options
| author | Pierre Rousseau <pro@odoo.com> | 2019-09-06 09:30:31 +0000 |
|---|---|---|
| committer | Pierre Rousseau <pro@odoo.com> | 2019-09-10 09:02:42 +0000 |
| commit | 4242ddd7a8e5b979a3dc679dacd8e5c29edb4c2b (patch) | |
| tree | a6a7c09c200890407f5d2ba8d82e9df1d646db82 | |
| parent | 6c7c97a6b60000e2d74d3c655400dfe3fb8b58da (diff) | |
[FIX] crm_iap_lead_enrich: correctly get payload
Before this commit, int was compared to a string when trying to retrieves company data in the payload.
Part of 2069155
closes odoo/odoo#36601
Signed-off-by: Rémi Rahir (rar) <rar@odoo.com>
| -rw-r--r-- | addons/crm_iap_lead_enrich/models/crm_lead.py | 2 | ||||
| -rw-r--r-- | addons/crm_iap_lead_enrich/tests/common.py | 4 |
2 files changed, 3 insertions, 3 deletions
diff --git a/addons/crm_iap_lead_enrich/models/crm_lead.py b/addons/crm_iap_lead_enrich/models/crm_lead.py index 1c32078610c..817cd6f81d3 100644 --- a/addons/crm_iap_lead_enrich/models/crm_lead.py +++ b/addons/crm_iap_lead_enrich/models/crm_lead.py @@ -68,7 +68,7 @@ class Lead(models.Model): :param iap_response: dict{lead_id: company data or False} """ for lead in self.search([('id', 'in', list(iap_response.keys()))]): # handle unlinked data by performing a search - iap_data = iap_response.get(lead.id) + iap_data = iap_response.get(str(lead.id)) if not iap_data: lead.message_post_with_view('crm_iap_lead_enrich.mail_message_lead_enrich_notfound', subtype_id=self.env.ref('mail.mt_note').id) continue diff --git a/addons/crm_iap_lead_enrich/tests/common.py b/addons/crm_iap_lead_enrich/tests/common.py index 7b9942a9a2c..ccdc604c12a 100644 --- a/addons/crm_iap_lead_enrich/tests/common.py +++ b/addons/crm_iap_lead_enrich/tests/common.py @@ -41,9 +41,9 @@ class MockIAPEnrich(common.BaseCase): raise exceptions.AccessError( 'The url that this service requested returned an error. Please contact the author of the app. The url it tried to contact was ' + local_endpoint ) - result[lead_id] = dict(sim_result) + result[str(lead_id)] = dict(sim_result) if email_data and email_data.get(email): - result[lead_id].update(email_data[email]) + result[str(lead_id)].update(email_data[email]) return result try: |
