From 9c1b0f6164617faedef6f4e9a800641b83d94343 Mon Sep 17 00:00:00 2001 From: "dle@openerp.com" <> Date: Tue, 2 Apr 2013 12:13:31 +0200 Subject: [PATCH] [FIX]crm: crm lead/opp merge, when opp has stage with state cancel, then it is less important than leads with stage which are not in state cancel bzr revid: dle@openerp.com-20130402101331-12skhykfzrv35nno --- addons/crm/crm_lead.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/crm/crm_lead.py b/addons/crm/crm_lead.py index 332390ff2df..fe48c9cc30c 100644 --- a/addons/crm/crm_lead.py +++ b/addons/crm/crm_lead.py @@ -632,7 +632,7 @@ class crm_lead(base_stage, format_address, osv.osv): sequence = -1 if opportunity.stage_id and opportunity.stage_id.state != 'cancel': sequence = opportunity.stage_id.sequence - sequenced_opps.append(((int(opportunity.type == 'opportunity'), sequence, -opportunity.id), opportunity)) + sequenced_opps.append(((int(sequence != -1 and opportunity.type == 'opportunity'), sequence, -opportunity.id), opportunity)) sequenced_opps.sort(reverse=True) opportunities = map(itemgetter(1), sequenced_opps)