From 92de5d9502660ecc61e7ac921883acac8d66a679 Mon Sep 17 00:00:00 2001 From: "Adesh Jolhe (adjo)" Date: Wed, 30 Mar 2022 04:43:23 +0000 Subject: [PATCH] [IMP] project: fix the rating visibility on kanban,list,form views Before this commit, the rating feature is visible in some `project.task` views even if the customer rating field is disabled on the project related. Unexpected behavior when the feature is disabled on the project: - the rating column field is visible in project.task list view - the rating icon is visible in project.task kanban and form view This commit fixes the rating icon and rating field visibility by adding a condition to check if the feature is enabled on the project. task-2762166 closes odoo/odoo#86103 Related: odoo/enterprise#25129 Signed-off-by: Laurent Stukkens (ltu) --- addons/project/models/project.py | 1 + addons/project/views/project_views.xml | 11 +++++++---- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/addons/project/models/project.py b/addons/project/models/project.py index 124d0761630..c0ed1f12086 100644 --- a/addons/project/models/project.py +++ b/addons/project/models/project.py @@ -1053,6 +1053,7 @@ class Task(models.Model): 'res.company', string='Company', compute='_compute_company_id', store=True, readonly=False, required=True, copy=True, default=_default_company_id) color = fields.Integer(string='Color Index') + rating_active = fields.Boolean(string='Project Rating Status', related="project_id.rating_active") attachment_ids = fields.One2many('ir.attachment', compute='_compute_attachment_ids', string="Main Attachments", help="Attachments that don't come from a message.") # In the domain of displayed_image_id, we couln't use attachment_ids because a one2many is represented as a list of commands so we used res_model & res_id diff --git a/addons/project/views/project_views.xml b/addons/project/views/project_views.xml index 5f8254901af..0c23321eb33 100644 --- a/addons/project/views/project_views.xml +++ b/addons/project/views/project_views.xml @@ -845,7 +845,8 @@ -