summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLucas Perais (lpe) <lpe@odoo.com>2019-10-08 12:59:24 +0000
committerfw-bot <otis@odoo.com>2019-10-09 10:27:06 +0000
commitbadd0c0bb249be40e8b2463cbbba7dd3f8e87b14 (patch)
tree479a50c4ce77401bf507090bf816f66a08effc34
parent64293fbdb0a247f689c1b0b0c580d9ce577af510 (diff)
[FIX] crm: lead to opportunity no link partner
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 odoo/odoo#38262 X-original-commit: f1d270e441320e16bf38261f64a473a5296d6719 Signed-off-by: Lucas Perais (lpe) <lpe@odoo.com>
-rw-r--r--addons/crm/wizard/crm_lead_to_opportunity.py8
1 files changed, 6 insertions, 2 deletions
diff --git a/addons/crm/wizard/crm_lead_to_opportunity.py b/addons/crm/wizard/crm_lead_to_opportunity.py
index b987bce5386..1a28ea172d1 100644
--- a/addons/crm/wizard/crm_lead_to_opportunity.py
+++ b/addons/crm/wizard/crm_lead_to_opportunity.py
@@ -95,8 +95,12 @@ class Lead2OpportunityPartner(models.TransientModel):
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')