From 39e07e7e83a29b9b38f9f04e1c9c0f7c911b256b Mon Sep 17 00:00:00 2001 From: Denis Ledoux Date: Wed, 20 Nov 2013 18:00:02 +0100 Subject: [PATCH] [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 --- addons/crm_partner_assign/crm_lead.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/crm_partner_assign/crm_lead.py b/addons/crm_partner_assign/crm_lead.py index 9bbecbd0a59..d7463355271 100644 --- a/addons/crm_partner_assign/crm_lead.py +++ b/addons/crm_partner_assign/crm_lead.py @@ -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):