Skip to content
Permalink
Browse files

[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
  • Loading branch information
DramixDW authored and tde-banana-odoo committed Feb 21, 2020
1 parent 7b82156 commit 84b1c50bbf996478a81be338f32c21747666d3ac
Showing with 3 additions and 10 deletions.
  1. +3 −2 addons/website_slides/controllers/mail.py
  2. +0 −8 addons/website_slides/i18n/website_slides.pot
@@ -8,7 +8,7 @@
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 @@ def mail_update_message(self, res_model, res_id, message, message_id, redirect=N
domain = [('res_model', '=', res_model), ('res_id', '=', res_id), ('website_published', '=', True), ('message_id', '=', message.id)]
rating = request.env['rating.rating'].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
@@ -2710,14 +2710,6 @@ msgstr ""
msgid "Partner"
msgstr ""

#. module: website_slides
#: code:addons/website_slides/models/slide_slide.py:0
#, python-format
msgid ""
"People already took this quiz. To keep course progression it should not be "
"deleted."
msgstr ""

#. module: website_slides
#: model_terms:ir.ui.view,arch_db:website_slides.courses_home
msgid "Pick a course"

0 comments on commit 84b1c50

Please sign in to comment.
You can’t perform that action at this time.