Skip to content
Snippets Groups Projects
Commit fe8c5b9b authored by Thibault Francois's avatar Thibault Francois Committed by Thibault Delavallée
Browse files

[IMP] crm: change in assignation process and limit

PURPOSE

All unassigned leads should be assigned to teams as soon as possible to ease
lead analysis.

Purpose of assign thresholds is to ensure sales people receive at least this
amount of leads within 30 days, counting lost and won leads. Giving them leads
regularly is also one goal of automatic assign.

SPECIFICATIONS: TEAM ALLOCATION

Team assignment has to be updated as we may have team domains that overlap.
We therefore remove maximum number of leads to allocate to teams. Instead all
available unassigned leads are allocated within teams.

  - Solution: assign all available leads and not a count based on team's
    capacity. This notably reverts the main goal of odoo/odoo@6df2f0cfc0309badfd58471e413ece695d629009
    (see odoo/odoo#48422)

This assignment process is done proportionally to the team capacity. It is
computed as the sum of each member's maximum assignment counter. This means
that with a team having twice as much sale capacity than another team sharing
the same domain: first team should receive about 2/3 of leads while the second
one should receive the remaining 1/3.

  - Solution: assign lead one by one. Choose a team randomly using a weighted
    random algorithm, based on team's members capacity.

SPECIFICATIONS: MEMBER ASSIGN

Counting every lead whatever its state may lead to an inconvenient situation.
Moreover salespersons may opt-out from assign by setting their max capacity
to 0, for example when going on holidays.

When doing that lead assignment is not smooth and getting back to a full
pipe may take several days. To solve that issue a compensation is added in
assignment quota done to sales people. Salespersons having few leads will
get a boost in assign as soon as they get back in assign process. When being
near maximum compensation is nearing 0 and daily quota is given.

PERFORMANCE

During team assignation, assigning lead one by one may cause performance issue.
Since PLS is computed at each flush, so we want to flush after a bunch of lead.
To solve that we obviously need to not commit at each assignation but
also avoid to search for duplicate at each assignation, that why the
search for duplicates is done at the beginning of the process and stored
in memory.

LINKS

Task ID-2444908 (assign fixes)
Task ID-2489951 (assign process improvements)
COM PR odoo/odoo#70172

X-original-commit: 83f72711e7affa8b0ad997b9ee262326e9577d54
parent 74d6455c
Branches
Tags
No related merge requests found
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment