diff options
| author | RVE-odoo <rve@odoo.com> | 2020-02-21 14:50:31 +0000 |
|---|---|---|
| committer | Thibault Delavallée <tde@odoo.com> | 2020-03-25 17:29:21 +0000 |
| commit | 3efffa8a556d20001e232661e218bdda2c05f1c5 (patch) | |
| tree | eda8f38f68edd2bfd7e1b3eb7501cb306a4987ab | |
| parent | 466217ff6cc6c30a4014b4fb0cc0566f32869268 (diff) | |
[FIX] website_slides: allow feedback update on review update
Currently, when updating a review on a course, the feedback field is not
updated on the rating model. Therefore, the backend view for rating is
always displaying the first feedback posted
Task ID 2184038
closes odoo/odoo#48382
X-original-commit: f2d04753be9f1feb75e575b0598b3520caa4744d
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
| -rw-r--r-- | addons/website_slides/controllers/mail.py | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/addons/website_slides/controllers/mail.py b/addons/website_slides/controllers/mail.py index 1d1c62bcee7..30d7c911358 100644 --- a/addons/website_slides/controllers/mail.py +++ b/addons/website_slides/controllers/mail.py @@ -8,7 +8,7 @@ from werkzeug.exceptions import NotFound, Forbidden from odoo import http from odoo.http import request from odoo.addons.portal.controllers.mail import _check_special_access, PortalChatter -from odoo.tools import plaintext2html +from odoo.tools import plaintext2html, html2plaintext class SlidesPortalChatter(PortalChatter): @@ -67,7 +67,8 @@ class SlidesPortalChatter(PortalChatter): domain = [('res_model', '=', res_model), ('res_id', '=', res_id), ('is_internal', '=', False), ('message_id', '=', message.id)] rating = request.env['rating.rating'].sudo().search(domain, order='write_date DESC', limit=1) rating.write({ - 'rating': float(post['rating_value']) + 'rating': float(post['rating_value']), + 'feedback': html2plaintext(message.body), }) # redirect to specified or referrer or simply channel page as fallback |
