[FIX] crm.lead: salesman allocation should loop through given users

bzr revid: odo@openerp.com-20120425174805-4offt36tyazfhxkr
This commit is contained in:
Olivier Dony 2012-04-25 19:48:05 +02:00
parent b606b1281c
commit 6d88302403
1 changed files with 2 additions and 2 deletions

View File

@ -669,9 +669,9 @@ class crm_lead(crm_case, osv.osv):
value = {}
if team_id:
value['section_id'] = team_id
if index < len(user_ids):
if user_ids:
value['user_id'] = user_ids[index]
index += 1
index = (index + 1) % len(user_ids)
if value:
self.write(cr, uid, [lead_id], value, context=context)
return True