From 93adbdbb208a29b0a61b97a502bbbadb16e8e60a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9rome=20Maes?= Date: Mon, 23 Oct 2017 16:13:31 +0200 Subject: [PATCH] [IMP] project: simplify filters for rating Since rating in on project directly, and task and issue are merged, we can simplify some domain and replaced them by default filters. The search domain will be less complex and the performance will be better. --- addons/project/models/project.py | 2 +- addons/project/views/project_views.xml | 5 +---- addons/project/views/rating_views.xml | 15 +-------------- addons/rating/views/rating_view.xml | 4 ++-- 4 files changed, 5 insertions(+), 21 deletions(-) diff --git a/addons/project/models/project.py b/addons/project/models/project.py index 4f5d68b0aea..c1e802839da 100644 --- a/addons/project/models/project.py +++ b/addons/project/models/project.py @@ -409,7 +409,7 @@ class Project(models.Model): action['name'] = _('Ratings of %s') % (self.name,) action_context = safe_eval(action['context']) if action['context'] else {} action_context.update(self._context) - action_context['search_default_rating_tasks'] = 1 + action_context['search_default_parent_res_name'] = self.name return dict(action, context=action_context) # --------------------------------------------------- diff --git a/addons/project/views/project_views.xml b/addons/project/views/project_views.xml index a09293f80df..3fc53cf4892 100644 --- a/addons/project/views/project_views.xml +++ b/addons/project/views/project_views.xml @@ -124,9 +124,6 @@ -

@@ -320,7 +317,7 @@
-
+
No rating yet diff --git a/addons/project/views/rating_views.xml b/addons/project/views/rating_views.xml index 87dc95ac43f..7c731ac5963 100644 --- a/addons/project/views/rating_views.xml +++ b/addons/project/views/rating_views.xml @@ -22,7 +22,7 @@ Rating rating.rating kanban,tree,graph,pivot,form - [('consumed','=',True), ('parent_res_model','=','project.project'), ('parent_res_id','=',active_id)] + [('consumed','=',True), ('parent_res_model','=','project.project')]

@@ -31,19 +31,6 @@ - - Ratings for tasks - rating.rating - kanban,tree,graph,pivot,form - [('consumed','=',True), ('parent_res_model','=','project.project'), ('parent_res_id','=',active_id), ('res_model','=','project.task')] - - -

- There is no rating for tasks of this project at the moment. -

-
- - Customer Ratings rating.rating diff --git a/addons/rating/views/rating_view.xml b/addons/rating/views/rating_view.xml index 10e1894b0dc..5c6100cadb1 100644 --- a/addons/rating/views/rating_view.xml +++ b/addons/rating/views/rating_view.xml @@ -134,9 +134,9 @@ - + - +