[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) <xmo@odoo.com>
This commit is contained in:
@@ -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'] = {
|
||||
|
||||
Reference in New Issue
Block a user