Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FIX] website_slides: feedback update on review update #45963

Conversation

@DramixDW
Copy link
Contributor

DramixDW commented Feb 21, 2020

Currently, when updating a review on a course, the feedback field is not
updated on the rating model. Therefore, the back-end view for rating is
always displaying the first feedback posted

task-2184038

--
I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr

Copy link
Contributor

sdegueldre left a comment

Minor review to get you used to the process :)

For the commit message, convention is [TAG] module_name: description of the commit. Don't forget a space after the tag and after the colon. Also, here the technical module name is website_slides (it's the folder name in addons) even though we call it "elearning" or "courses" for end users. Using a consistent name allows us to grep for commits that touch certain modules more easily.

For the task, the convention is task-###### when it's a generic task, and opw-###### when it's a customer ticket.

Also it seems your github account and your odoo email address are not linked properly.

@@ -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

This comment has been minimized.

Copy link
@sdegueldre

sdegueldre Mar 10, 2020

Contributor

Space after commas that separate imports

This comment has been minimized.

Copy link
@DramixDW

DramixDW Mar 10, 2020

Author Contributor

Fixed

@@ -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),

This comment has been minimized.

Copy link
@sdegueldre

sdegueldre Mar 10, 2020

Contributor

If you look at the patch for this commit, because there wasn't already a trailing comma, you had to change the existing line, which means any changes targeting this line will now conflict when forward porting, all because someone forgot the comma. Using the trailing comma like you did here prevents this problem from happening in the future, so good job and keep doing it :)

This comment has been minimized.

Copy link
@DramixDW

DramixDW Mar 10, 2020

Author Contributor

Thanks :)

@DramixDW DramixDW changed the title [FIX]elearning:feedback update on review update [FIX] website_slides:feedback update on review update Mar 10, 2020
@DramixDW DramixDW changed the title [FIX] website_slides:feedback update on review update [FIX] website_slides: feedback update on review update Mar 10, 2020
@DramixDW DramixDW force-pushed the odoo-dev:13.0-rating-feedback-should-update-on-message-update-rve branch from b9ecac4 to 0e8fee9 Mar 10, 2020
@robodoo robodoo removed the CI 🤖 label Mar 10, 2020
@DramixDW DramixDW force-pushed the odoo-dev:13.0-rating-feedback-should-update-on-message-update-rve branch 3 times, most recently from cafae38 to aa40ddc Mar 25, 2020
@tde-banana-odoo tde-banana-odoo force-pushed the odoo-dev:13.0-rating-feedback-should-update-on-message-update-rve branch 3 times, most recently from d15cea4 to 84b1c50 Mar 25, 2020
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
@tde-banana-odoo tde-banana-odoo force-pushed the odoo-dev:13.0-rating-feedback-should-update-on-message-update-rve branch from 84b1c50 to 53f228f Mar 25, 2020
@tde-banana-odoo

This comment has been minimized.

Copy link
Contributor

tde-banana-odoo commented Mar 25, 2020

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

5 participants
You can’t perform that action at this time.