From 91954d029f38d6a7e000fca352f0e4eefab49b3d Mon Sep 17 00:00:00 2001 From: hacker on test server <> Date: Fri, 1 Feb 2013 17:18:50 +0100 Subject: [PATCH] [FIX] crm leads merge views and action = merge not well placed bzr revid: hacker_on_test_server-20130201161850-m9xnp901la968ogo --- addons/crm/wizard/crm_lead_to_opportunity.py | 7 ++++--- addons/crm/wizard/crm_lead_to_opportunity_view.xml | 2 +- addons/crm/wizard/crm_merge_opportunities_view.xml | 10 +++++++--- 3 files changed, 12 insertions(+), 7 deletions(-) diff --git a/addons/crm/wizard/crm_lead_to_opportunity.py b/addons/crm/wizard/crm_lead_to_opportunity.py index 48603e6beff..9ae0153c7dd 100644 --- a/addons/crm/wizard/crm_lead_to_opportunity.py +++ b/addons/crm/wizard/crm_lead_to_opportunity.py @@ -108,7 +108,7 @@ class crm_lead2opportunity_partner(osv.osv_memory): lead.allocate_salesman(cr, uid, lead_ids, user_ids, team_id=team_id, context=context) return res - def _merge_opportunity(self, cr, uid, ids, opportunity_ids, action='merge', context=None): + def _merge_opportunity(self, cr, uid, ids, opportunity_ids, context=None): if context is None: context = {} res = False @@ -117,7 +117,7 @@ class crm_lead2opportunity_partner(osv.osv_memory): # merged into the first opportunity (and the rest deleted) opportunity_ids = [o.id for o in opportunity_ids] lead_ids = context.get('active_ids', []) - if action == 'merge' and lead_ids and opportunity_ids: + if lead_ids and opportunity_ids: # Add the leads in the to-merge list, next to other opps # (the fact that they're passed in context['lead_ids'] means that # they cannot be selected to contain the result of the merge. @@ -137,7 +137,8 @@ class crm_lead2opportunity_partner(osv.osv_memory): lead_ids = context.get('active_ids', []) data = self.browse(cr, uid, ids, context=context)[0] self._convert_opportunity(cr, uid, ids, {'lead_ids': lead_ids}, context=context) - self._merge_opportunity(cr, uid, ids, data.opportunity_ids, data.name, context=context) + if data.name == 'merge': + self._merge_opportunity(cr, uid, ids, data.opportunity_ids, context=context) return lead.redirect_opportunity_view(cr, uid, lead_ids[0], context=context) diff --git a/addons/crm/wizard/crm_lead_to_opportunity_view.xml b/addons/crm/wizard/crm_lead_to_opportunity_view.xml index 6e97dec9a33..0459b3093dd 100644 --- a/addons/crm/wizard/crm_lead_to_opportunity_view.xml +++ b/addons/crm/wizard/crm_lead_to_opportunity_view.xml @@ -14,7 +14,7 @@ - + diff --git a/addons/crm/wizard/crm_merge_opportunities_view.xml b/addons/crm/wizard/crm_merge_opportunities_view.xml index 4b035200737..6555e5b8f28 100644 --- a/addons/crm/wizard/crm_merge_opportunities_view.xml +++ b/addons/crm/wizard/crm_merge_opportunities_view.xml @@ -11,10 +11,14 @@ + - - - + + + + + +