[FIX] crm: add minimum of return value to _get_assignment_quota
The method _assign_and_convert_leads() gets called when the CRM: Assign Leads cron is called.
The values in the list `weights` gets caluclated in a way that memebers with a lower
`lead_month`count` value gets a higher weight when randomizing assignement of a new lead. Assuming that the
max assignment per member is consistent (or default = 30).
Assume that each sale member belonging to any team has around 500 leads assigned to them the previous
month(`lead_month_count`) and `work_days` is set to `0.2`. The return value of the method
`_get_assignement_quota()` in this case would be 0 for every member, which causes the list `weights`
to get populated with just zeros. This raises a `ValueError: Total of weights must be greater than zero`.
Fix:
Make sure the minimum weight for each member is at least 1 and not 0.
opw-3171085
closes odoo/odoo#118156
Signed-off-by:
Thibault Delavallee (tde) <tde@openerp.com>
Loading