Skip to content

Commit

Permalink
[FIX] crm: lead to opportunity no link partner
Browse files Browse the repository at this point in the history
Have a lead with a partner on it, convert it to opportunity
in the conversion wizard, tick "don't link to customer"

Before this commit, the opportunity has been linked to the
lead's partner

After this commit, the opportunity is not linked to any partner

OPW 2077692

closes #38202

Signed-off-by: Lucas Perais (lpe) <lpe@odoo.com>
  • Loading branch information
kebeclibre committed Oct 8, 2019
1 parent 6629411 commit f1d270e
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions addons/crm/wizard/crm_lead_to_opportunity.py
Expand Up @@ -96,8 +96,12 @@ def _convert_opportunity(self, vals):
leads = self.env['crm.lead'].browse(vals.get('lead_ids'))
for lead in leads:
self_def_user = self.with_context(default_user_id=self.user_id.id)
partner_id = self_def_user._create_partner(
lead.id, self.action, vals.get('partner_id') or lead.partner_id.id)

partner_id = False
if self.action != 'nothing':
partner_id = self_def_user._create_partner(
lead.id, self.action, vals.get('partner_id') or lead.partner_id.id)

res = lead.convert_opportunity(partner_id, [], False)
user_ids = vals.get('user_ids')

Expand Down

0 comments on commit f1d270e

Please sign in to comment.