[FIX]crm_partner_assign: use the probability of the stage of the lead instead of the probability ofthe lead directly to choose the lead to reassign, in case of the data is not correct in database (lead probability null, for instance)

bzr revid: dle@openerp.com-20131120170002-54qjaz7wr87u65k9
This commit is contained in:
Denis Ledoux 2013-11-20 18:00:02 +01:00
parent b5f2233381
commit 39e07e7e83
1 changed files with 1 additions and 1 deletions

View File

@ -46,7 +46,7 @@ class crm_lead(osv.osv):
def assign_salesman_of_assigned_partner(self, cr, uid, ids, context=None):
salesmans_leads = {}
for lead in self.browse(cr, uid, ids, context=context):
if (lead.probability > 0 and lead.probability < 100) or lead.stage_id.sequence == 1:
if (lead.stage_id.probability > 0 and lead.stage_id.probability < 100) or lead.stage_id.sequence == 1:
if lead.partner_assigned_id and lead.partner_assigned_id.user_id and lead.partner_assigned_id.user_id != lead.user_id:
salesman_id = lead.partner_assigned_id.user_id.id
if salesmans_leads.get(salesman_id):