[FIX]crm: leads/opps merge order, condition was not correct: lead/opp with stage...
authorDenis Ledoux <dle@openerp.com>
Wed, 16 Oct 2013 15:34:57 +0000 (17:34 +0200)
committerDenis Ledoux <dle@openerp.com>
Wed, 16 Oct 2013 15:34:57 +0000 (17:34 +0200)
bzr revid: dle@openerp.com-20131016153457-42a235ks80226b8o

addons/crm/crm_lead.py

index a4350e5..046d441 100644 (file)
@@ -616,7 +616,7 @@ class crm_lead(format_address, osv.osv):
         # An Opportunity always has higher confidence level than a lead, unless its stage probability is 0.0
         for opportunity in opportunities:
             sequence = -1
-            if opportunity.stage_id and opportunity.stage_id.probability != 0 and opportunity.stage_id.sequence != 1:
+            if opportunity.stage_id and (opportunity.stage_id.probability != 0 or opportunity.stage_id.sequence == 1):
                 sequence = opportunity.stage_id.sequence
             sequenced_opps.append(((int(sequence != -1 and opportunity.type == 'opportunity'), sequence, -opportunity.id), opportunity))