Skip to content
Snippets Groups Projects
Commit 2c198020 authored by std-odoo's avatar std-odoo
Browse files

[FIX] crm: fix the rule based assignment


Bug
===
Since fe8c5b9b , if you have a team
with set to `assignment_max` and you try to automatically assign the
leads an error is raised.

Technical: in `_allocate_leads` we skip a team if `assignment_max` is
Falsy. So when we prepare the values for the notifications, the key
might not be present in the dict an error is raised.

Task-2658696

closes odoo/odoo#78054

X-original-commit: 7c46b441266ff0336bf86d10ac2ee45d2a2c2959
Signed-off-by: default avatarThibault Delavallee (tde) <tde@openerp.com>
parent 0b34db23
Branches
Tags
No related merge requests found
......@@ -317,8 +317,8 @@ class Team(models.Model):
plaintext or html message at caller's will
"""
# extract some statistics
assigned = sum(len(teams_data[team]['assigned']) + len(teams_data[team]['merged']) for team in self)
duplicates = sum(len(teams_data[team]['duplicates']) for team in self)
assigned = sum(len(teams_data[team]['assigned']) + len(teams_data[team]['merged']) for team in teams_data)
duplicates = sum(len(teams_data[team]['duplicates']) for team in teams_data)
members = len(members_data)
members_assigned = sum(len(member_data['assigned']) for member_data in members_data.values())
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment