From 476f6d5e16d93dd390bc8d8d4d137c6f7a64532e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thibault=20Delavall=C3=A9e?= Date: Fri, 8 Jan 2021 11:37:23 +0000 Subject: [PATCH] [REF] crm: ensure automatic assignment works out of the box GLOBAL PURPOSE Ability to have salesmen belonging to several sales team is a core requirement of CRM. It is therefore moved from website_crm_score to crm along with cleaning and behavior improvement. Automatic lead assignment is also moved and cleaned. SPECIFICATIONS Assignment max being set to 0 means member is out of automatic assign process. In that case assignment information (domain in form view, gauge in kanban view) are hidden to lighten member form view. Its default value is now set to 30. It means that newly created members by default are available for automatic assignment. LINKS Task ID-2086889 (main task) Task ID-2357969 (scoring migration task) Community PR odoo/odoo#48422 Enterprise PR odoo/enterprise#499 Upgrade PR odoo/upgrade#996 --- addons/crm/models/crm_team_member.py | 2 +- addons/crm/views/crm_team_member_views.xml | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/addons/crm/models/crm_team_member.py b/addons/crm/models/crm_team_member.py index e1776761c85..edb0fc041c2 100644 --- a/addons/crm/models/crm_team_member.py +++ b/addons/crm/models/crm_team_member.py @@ -21,7 +21,7 @@ class Team(models.Model): # assignment assignment_enabled = fields.Boolean(related="crm_team_id.assignment_enabled") assignment_domain = fields.Char('Assignment Domain', tracking=True) - assignment_max = fields.Integer('Max Leads (last 30 days)') + assignment_max = fields.Integer('Max Leads (last 30 days)', default=30) lead_month_count = fields.Integer( 'Leads (30 days)', compute='_compute_lead_month_count', help='Lead assigned to this member those last 30 days') diff --git a/addons/crm/views/crm_team_member_views.xml b/addons/crm/views/crm_team_member_views.xml index c3ba0dd8305..2abce300dd4 100644 --- a/addons/crm/views/crm_team_member_views.xml +++ b/addons/crm/views/crm_team_member_views.xml @@ -25,7 +25,8 @@ attrs="{'invisible': [('assignment_enabled', '=', False)]}"> + options="{'max_field': 'assignment_max'}" + attrs="{'invisible': [('assignment_max', '=', 0)]}"/> @@ -47,7 +48,8 @@ (max) + options="{'model': 'crm.lead'}" + attrs="{'invisible': [('assignment_max', '=', 0)]}"/>