diff --git a/addons/crm/models/crm_team.py b/addons/crm/models/crm_team.py index 575fe878102..4ada6a3b3b2 100644 --- a/addons/crm/models/crm_team.py +++ b/addons/crm/models/crm_team.py @@ -43,6 +43,9 @@ class Team(models.Model): lead_all_assigned_month_count = fields.Integer( string='# Leads/Opps assigned this month', compute='_compute_lead_all_assigned_month_count', help="Number of leads and opportunities assigned this last month.") + lead_all_assigned_month_exceeded = fields.Boolean('Exceed monthly lead assignement', compute="_compute_lead_all_assigned_month_count", + help="True if the monthly lead assignment count is greater than the maximum assignment limit, false otherwise." + ) opportunities_count = fields.Integer( string='# Opportunities', compute='_compute_opportunities_data') opportunities_amount = fields.Monetary( @@ -82,10 +85,11 @@ class Team(models.Model): for team in self: team.lead_unassigned_count = counts.get(team.id, 0) - @api.depends('crm_team_member_ids.lead_month_count') + @api.depends('crm_team_member_ids.lead_month_count', 'assignment_max') def _compute_lead_all_assigned_month_count(self): for team in self: team.lead_all_assigned_month_count = sum(member.lead_month_count for member in team.crm_team_member_ids) + team.lead_all_assigned_month_exceeded = team.lead_all_assigned_month_count > team.assignment_max def _compute_opportunities_data(self): opportunity_data = self.env['crm.lead']._read_group([ diff --git a/addons/crm/report/crm_opportunity_report_views.xml b/addons/crm/report/crm_opportunity_report_views.xml index e13f22cf09d..f53dee949d7 100644 --- a/addons/crm/report/crm_opportunity_report_views.xml +++ b/addons/crm/report/crm_opportunity_report_views.xml @@ -1,6 +1,17 @@ + + crm.lead.tree.opportunity.reporting + crm.lead + + primary + + + + + + crm.opportunity.report.pivot @@ -142,6 +153,9 @@ + + + @@ -155,7 +169,7 @@ eval="[(5, 0, 0), (0, 0, {'view_mode': 'graph', 'view_id': ref('crm_opportunity_report_view_graph')}), (0, 0, {'view_mode': 'pivot', 'view_id': ref('crm_opportunity_report_view_pivot')}), - (0, 0, {'view_mode': 'tree', 'view_id': ref('crm_case_tree_view_oppor')})]"/> + (0, 0, {'view_mode': 'tree', 'view_id': ref('crm_lead_view_tree_opportunity_reporting')})]"/>

No data found! diff --git a/addons/crm/static/src/scss/crm_team.scss b/addons/crm/static/src/scss/crm_team.scss new file mode 100644 index 00000000000..df67dc03dfa --- /dev/null +++ b/addons/crm/static/src/scss/crm_team.scss @@ -0,0 +1,11 @@ +.o_crm_team_form_view { + /* + * Used to conditionnaly add a css class on a record field. + * Add text-warning on the element with class o_crm_lead_month_assignment + * only if the element with o_crm_lead_all_assigned_month_exceeded is visible + * in the template. + */ + div.o_crm_lead_all_assigned_month_exceeded + .o_crm_lead_month_assignment { + @extend .text-warning; + } +} diff --git a/addons/crm/views/crm_lead_views.xml b/addons/crm/views/crm_lead_views.xml index 354f7ad2d52..dea34eccdb9 100644 --- a/addons/crm/views/crm_lead_views.xml +++ b/addons/crm/views/crm_lead_views.xml @@ -50,43 +50,37 @@

-

-
-

-
- Company Logo +
+

-
+
Company type
-
+
Founded
@@ -45,7 +45,7 @@ -
+
Sectors
@@ -54,19 +54,19 @@
-
+
Employees
-
+
Estimated revenue
per year
-
+
Phone
@@ -75,7 +75,7 @@
- -
+
Timezone
-
+
Technologies Used
@@ -98,12 +98,18 @@
-
+
Twitter
diff --git a/addons/iap_mail/static/src/scss/iap_mail.scss b/addons/iap_mail/static/src/scss/iap_mail.scss new file mode 100644 index 00000000000..727487e6f7d --- /dev/null +++ b/addons/iap_mail/static/src/scss/iap_mail.scss @@ -0,0 +1,4 @@ +.o_partner_autocomplete_enrich_info i { + /* To prevent the icons from being cropped when there is not enough available space */ + min-width: fit-content; +} diff --git a/addons/mail/views/mail_activity_views.xml b/addons/mail/views/mail_activity_views.xml index 368015a7c17..50029945cef 100644 --- a/addons/mail/views/mail_activity_views.xml +++ b/addons/mail/views/mail_activity_views.xml @@ -124,7 +124,7 @@ - + diff --git a/addons/sales_team/views/crm_team_member_views.xml b/addons/sales_team/views/crm_team_member_views.xml index 2aeed4a5165..9386b4eb905 100644 --- a/addons/sales_team/views/crm_team_member_views.xml +++ b/addons/sales_team/views/crm_team_member_views.xml @@ -120,7 +120,7 @@ - + diff --git a/addons/sales_team/views/crm_team_views.xml b/addons/sales_team/views/crm_team_views.xml index 15bc6fa4f36..2f760ffd99b 100644 --- a/addons/sales_team/views/crm_team_views.xml +++ b/addons/sales_team/views/crm_team_views.xml @@ -11,6 +11,7 @@ + @@ -21,7 +22,7 @@ crm.team.form crm.team -
+