[FIX]crm: leads/opps merge order, condition was not correct: lead/opp with stage sequence = 1 where regarded as canceled, or they are acutally regarded as new.

bzr revid: dle@openerp.com-20131016153457-42a235ks80226b8o
This commit is contained in:
Denis Ledoux
2013-10-16 17:34:57 +02:00
parent b95f5443db
commit bbeb6e60aa
+1 -1
View 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))