From f8d47a4a1d6ce1f44fc5f5f86d135cdb413e11bf Mon Sep 17 00:00:00 2001 From: "Ravi Gohil (OpenERP)" Date: Wed, 7 Aug 2013 15:16:30 +0530 Subject: [PATCH] [FIX] crm: While processing the 'Convert to Opportunity' wizard in leads view, if the system found matching partner from the information provided in lead and suggested that partner in the wizard, and later if we decided not to link the opportunity to existing partner but to create a new one, it never create one, but will link to the priorly suggested partner: (Maintenance Case : 596231) lp bug: https://launchpad.net/bugs/1208436 fixed bzr revid: rgo@tinyerp.com-20130807094630-efk7yo1ia27vpq5i --- addons/crm/wizard/crm_lead_to_opportunity.py | 3 +++ addons/crm/wizard/crm_lead_to_opportunity_view.xml | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/addons/crm/wizard/crm_lead_to_opportunity.py b/addons/crm/wizard/crm_lead_to_opportunity.py index 3c847ade42a..1c8b8331b47 100644 --- a/addons/crm/wizard/crm_lead_to_opportunity.py +++ b/addons/crm/wizard/crm_lead_to_opportunity.py @@ -37,6 +37,9 @@ class crm_lead2opportunity_partner(osv.osv_memory): 'opportunity_ids': fields.many2many('crm.lead', string='Opportunities'), } + def onchange_action(self, cr, uid, ids, action, context=None): + return {'value': {'partner_id': False if action != 'exist' else self._find_matching_partner(cr, uid, context=context)}} + def default_get(self, cr, uid, fields, context=None): """ Default get for name, opportunity_ids. diff --git a/addons/crm/wizard/crm_lead_to_opportunity_view.xml b/addons/crm/wizard/crm_lead_to_opportunity_view.xml index 00686de1c8e..9f7701a1752 100644 --- a/addons/crm/wizard/crm_lead_to_opportunity_view.xml +++ b/addons/crm/wizard/crm_lead_to_opportunity_view.xml @@ -27,7 +27,7 @@ - +