odoo/odoo#201256

Created by Piero Calenzani (pca)

Blocked

  • Merge method
  • Review
  • CI
label
odoo-dev:18.0-opw-4573681-pca
head
949cb641de32dc55b90eabc3ab5278268b4a4ddf
odoo/odoo
18.0 #201256 missing r+
saas-18.2
saas-18.3
saas-18.4
19.0
master

[FIX] crm: recompute probability for team-specific stages

Before this commit, the Predictive Lead Scoring would calculate counts
for won / lost / total using the first global stage available. In
databases where there were no global stages, this resulted in zeros
for all variables which skipped writing an updated probability.

Behavior before fix:
1. Assign all crm stages to a team
2. Create a lead and move it to a won stage
-> Probability computed as 100% and set as won
3. Move lead back to a normal stage
-> Probability is not updated and remains as 100% and 'won'

This change will add an extra computation if the won / lost counts are
zeroes. While keeping using the current method (and potential overrides),
we will now fallback on the first stage of the team in that case. If
different, for instance when all stages are team-specific, or if first stage(s)
are team-specific, we will use those counts instead, if any. Behavior will not
be changed when the first stage overall is global, as in that case the first
stage of the team is that one.

opw-4573681


I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr