From f798d843228b93d9062d492e38bfc7eeab2f2dfd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9rome=20Maes?= Date: Tue, 10 Mar 2015 11:11:59 +0100 Subject: [PATCH] [FIX] website_rating_project_issue : fix the domain to retrieve rating of particular project and use website.image_url to display user avatar. --- .../website_rating_project_issue/controllers/main.py | 9 +++++---- .../views/website_rating_project.xml | 12 ++++++------ 2 files changed, 11 insertions(+), 10 deletions(-) diff --git a/addons/website_rating_project_issue/controllers/main.py b/addons/website_rating_project_issue/controllers/main.py index cd09ea40f6e..6b10139d7e1 100644 --- a/addons/website_rating_project_issue/controllers/main.py +++ b/addons/website_rating_project_issue/controllers/main.py @@ -9,21 +9,22 @@ class WebsiteRatingProject(http.Controller): @http.route(['/project/rating/'], type='http', auth="public", website=True) def index(self, **kw): - projects = request.env['project.project'].search([]) + projects = request.env['project.project'].search([('is_visible_happy_customer', '=', 1)]) values = {'projects' : projects} return request.website.render('website_rating_project_issue.index', values) @http.route(['''/project/rating/=',todate)] + todate = (datetime.date.today()-datetime.timedelta(days=x)).strftime('%Y-%m-%d 00:00:00') + domdate = domain + [('create_date', '<=', yesterday), ('create_date', '>=', todate)] stats[x] = {0: 0, 5: 0, 10: 0} rating_stats = request.env['rating.rating'].read_group(domdate, [], ['rating']) total = reduce(lambda x, y: y['rating_count']+x, rating_stats, 0) diff --git a/addons/website_rating_project_issue/views/website_rating_project.xml b/addons/website_rating_project_issue/views/website_rating_project.xml index 115f1fd9e8f..cce51b3a2e8 100644 --- a/addons/website_rating_project_issue/views/website_rating_project.xml +++ b/addons/website_rating_project_issue/views/website_rating_project.xml @@ -74,21 +74,21 @@
Happy Feedback
-
+
%%
- Happy Feedback + Normal Feedback
-
+
%%
- Happy Feedback + Bad Feedback
-
+
%%
@@ -131,7 +131,7 @@
- +