'Assign salesmen and salesteam to a batch of leads.  If there are more
leads than salesmen, these salesmen will be assigned in round-robin.
E.g.: 4 salesmen (S1, S2, S3, S4) for 6 leads (L1, L2, ... L6).  They
will be assigned as followed: L1 - S1, L2 - S2, L3 - S3, L4 - S4,
L5 - S1, L6 - S2.
:param list ids: leads/opportunities ids to process
:param list user_ids: salesmen to assign
:param int team_id: salesteam to assign
:return bool'

@api.multi
def allocate_salesman(self, user_ids=None, team_id=False):

    index = 0
    for lead in self:
        value = {}
        if team_id:
            value['team_id'] = team_id
        if user_ids:
            value['user_id'] = user_ids[index]
            index = ((index + 1) % len(user_ids))
        if value:
            lead.write(value)
    return True
