From 1b487304464e89b343dabddf315bbb9733c33dec Mon Sep 17 00:00:00 2001 From: ryv-odoo Date: Tue, 6 Aug 2019 08:53:32 +0000 Subject: [PATCH] [IMP] website_rating : allow to comment message-based ratings PURPOSE Allow publishers to add a comment on frontend reviews with ratings. Purpose is to allow to give some feedback or context on published reviews. SPECIFICATIONS In order to answer to a rating message (review) of a course (eLearning) or a product (eCommerce) we add a way to the publisher to directly comment a review inside the website rating chatter. Any publisher can add/edit/remove comment of a rating message from the website. The goal is not to enter into a discussion but just to give a feedback. This comment is not sent or propagated to anyone, just displayed for information purpose. In portal chatter * add 1 button below a review "Comment" (for publishers of the website only) * only one comment possible by review/rating * when the comment is added, display * author name, date, comment * 2 buttons, only visible by the website publisher: edit and delete LINKS Task ID : 2026911 closes odoo/odoo#35956 Signed-off-by: Thibault Delavallee (tde) --- addons/rating/views/rating_view.xml | 2 +- addons/website_rating/__manifest__.py | 1 + addons/website_rating/controllers/__init__.py | 1 + .../controllers/portal_rating.py | 17 ++ addons/website_rating/models/mail_message.py | 16 +- addons/website_rating/models/rating.py | 19 +- .../static/src/js/portal_chatter.js | 203 ++++++++++++++++-- .../static/src/xml/portal_chatter.xml | 77 +++++++ .../website_rating/views/rating_templates.xml | 8 - addons/website_rating/views/rating_views.xml | 13 ++ .../website_slides/data/slide_user_demo.xml | 3 + 11 files changed, 335 insertions(+), 25 deletions(-) create mode 100644 addons/website_rating/controllers/portal_rating.py create mode 100644 addons/website_rating/views/rating_views.xml diff --git a/addons/rating/views/rating_view.xml b/addons/rating/views/rating_view.xml index 423c96b7e27..768577979af 100644 --- a/addons/rating/views/rating_view.xml +++ b/addons/rating/views/rating_view.xml @@ -21,7 +21,7 @@ rating.rating.form rating.rating -
+
+
+ +
+
+ + + +
+ avatar +
+
+
+
+
+ +

Published on

+
+ +
+
+
+ +
+ avatar +
+
+
+

Published on

+
+ +
+ + +
+
+
+
diff --git a/addons/website_rating/views/rating_templates.xml b/addons/website_rating/views/rating_templates.xml index 8f7a287f336..4eabc7c3b85 100644 --- a/addons/website_rating/views/rating_templates.xml +++ b/addons/website_rating/views/rating_templates.xml @@ -1,12 +1,5 @@ - - -