From 16f63fa55b7809a3d35ed7fb90368bc881c85aaf Mon Sep 17 00:00:00 2001 From: Nidhi Patel Date: Mon, 25 Oct 2021 07:26:01 +0000 Subject: [PATCH] [IMP] project, rating: add rating field to task tree and search view In this commit, we add the 'rating' field to the list view of 'project.task'. Also, make the field optional and hidden by default. rating_text field will be used to search tasks and tickets by rating text. closes #78973 task-2667754 Related: odoo/upgrade#3031 Related: odoo/enterprise#21880 Signed-off-by: Laurent Stukkens (ltu) --- addons/project/views/project_views.xml | 5 +++++ addons/rating/models/rating_mixin.py | 1 + 2 files changed, 6 insertions(+) diff --git a/addons/project/views/project_views.xml b/addons/project/views/project_views.xml index 8536b145380..1a8b2b1f9f3 100644 --- a/addons/project/views/project_views.xml +++ b/addons/project/views/project_views.xml @@ -23,6 +23,7 @@ + @@ -1224,6 +1225,10 @@ + diff --git a/addons/rating/models/rating_mixin.py b/addons/rating/models/rating_mixin.py index 59ecb368bf7..46b9f43e5f5 100644 --- a/addons/rating/models/rating_mixin.py +++ b/addons/rating/models/rating_mixin.py @@ -61,6 +61,7 @@ class RatingMixin(models.AbstractModel): rating_count = fields.Integer('Rating count', compute="_compute_rating_stats", compute_sudo=True) rating_avg = fields.Float("Rating Average", compute='_compute_rating_stats', compute_sudo=True) rating_percentage_satisfaction = fields.Float("Rating Satisfaction", compute='_compute_rating_satisfaction', compute_sudo=True) + rating_last_text = fields.Selection(string="Rating Text", groups='base.group_user', related="rating_ids.rating_text") @api.depends('rating_ids.rating', 'rating_ids.consumed') def _compute_rating_last_value(self):