From 7bd9d1a31ec91a5d96e6e2a3f2c194e5b32b62b9 Mon Sep 17 00:00:00 2001 From: "Florimond Husquinet (fhu)" Date: Tue, 15 Sep 2020 11:42:15 +0000 Subject: [PATCH] [FIX] mail_client_extension: link new company with existing partner If the partner was created then the company, the api would return the partner, find the corresponding company and return it with the partner, but not actually link the newly found/created company with the partner in the db. Would happen for example if the user had no reveal credit when he added the partner. Then credited his account and opened an email from the same partner again, triggering the creation and enrichment of the company. closes odoo/odoo#57825 X-original-commit: 5879f7dede16c8ba574ed648e4c91ca438eb93fa Signed-off-by: Xavier Morel (xmo) --- addons/mail_client_extension/controllers/main.py | 1 + 1 file changed, 1 insertion(+) diff --git a/addons/mail_client_extension/controllers/main.py b/addons/mail_client_extension/controllers/main.py index e04c4a26972..2a59c3d1f2f 100644 --- a/addons/mail_client_extension/controllers/main.py +++ b/addons/mail_client_extension/controllers/main.py @@ -220,6 +220,7 @@ class MailClientExtensionController(http.Controller): if not company: # create and enrich company company, enrichment_info = self._create_company_from_iap(sender_domain) response['enrichment_info'] = enrichment_info + partner.write({'parent_id': company}) response['partner']['company'] = self._get_company_dict(company) else: #no partner found response['partner'] = {