From 6e7b50708f0c400ecbde861554636f29248be2db Mon Sep 17 00:00:00 2001 From: std-odoo Date: Wed, 15 Sep 2021 11:36:26 +0000 Subject: [PATCH] [IMP] crm: remove the groups attributes on the recurring revenue fields Purpose ======= This commit remove the "groups" attribute on the recurring revenue fields. Instead we hide them directly in the views. This group was used only to turn on / off the feature, not for security reason. So it's fine to move the group in the views. It will help for the lead merge so we will not be forced to use SUDO during the merge. Task-2447721 PR odoo/odoo#75742 --- addons/crm/models/crm_lead.py | 10 ++++------ addons/crm/views/crm_lead_views.xml | 24 +++++++++++++----------- 2 files changed, 17 insertions(+), 17 deletions(-) diff --git a/addons/crm/models/crm_lead.py b/addons/crm/models/crm_lead.py index f0c34f52554..13b17bc9bdc 100644 --- a/addons/crm/models/crm_lead.py +++ b/addons/crm/models/crm_lead.py @@ -146,14 +146,12 @@ class Lead(models.Model): # Revenues expected_revenue = fields.Monetary('Expected Revenue', currency_field='company_currency', tracking=True) prorated_revenue = fields.Monetary('Prorated Revenue', currency_field='company_currency', store=True, compute="_compute_prorated_revenue") - recurring_revenue = fields.Monetary('Recurring Revenues', currency_field='company_currency', groups="crm.group_use_recurring_revenues", tracking=True) - recurring_plan = fields.Many2one('crm.recurring.plan', string="Recurring Plan", groups="crm.group_use_recurring_revenues") + recurring_revenue = fields.Monetary('Recurring Revenues', currency_field='company_currency', tracking=True) + recurring_plan = fields.Many2one('crm.recurring.plan', string="Recurring Plan") recurring_revenue_monthly = fields.Monetary('Expected MRR', currency_field='company_currency', store=True, - compute="_compute_recurring_revenue_monthly", - groups="crm.group_use_recurring_revenues") + compute="_compute_recurring_revenue_monthly") recurring_revenue_monthly_prorated = fields.Monetary('Prorated MRR', currency_field='company_currency', store=True, - compute="_compute_recurring_revenue_monthly_prorated", - groups="crm.group_use_recurring_revenues") + compute="_compute_recurring_revenue_monthly_prorated") company_currency = fields.Many2one("res.currency", string='Currency', related='company_id.currency_id', readonly=True) # Dates date_closed = fields.Datetime('Closed Date', readonly=True, copy=False) diff --git a/addons/crm/views/crm_lead_views.xml b/addons/crm/views/crm_lead_views.xml index ca0237a9125..3ae7b9d5a47 100644 --- a/addons/crm/views/crm_lead_views.xml +++ b/addons/crm/views/crm_lead_views.xml @@ -462,7 +462,7 @@ -
+
@@ -559,11 +559,11 @@
- + + + - - + +
@@ -634,11 +634,11 @@
- + + + - - + +
@@ -772,9 +772,11 @@ - - - + + + @@ -896,7 +898,7 @@ - +