[FIX] website_sale: star rating for first comment

For first comments on a product in the ecommerce we would not
have the star rating displayed till a page refresh, and the star widget
would not be reset after posting.

Also in other situations, we would get a 0 star widget when posting
comment without rating, but after a refresh the widget would dispappear.

With this change the new comment get the same stars as when refreshed.

opw-702608
This commit is contained in:
Nicolas Lempereur
2016-12-27 13:16:25 +01:00
parent cd3988e689
commit a497300be8
@@ -12,10 +12,8 @@ odoo.define('website_sale.rating', function (require) {
website_mail_thread.WebsiteMailThread.include({
prepend_message: function(message_data){
var rating_enabled = this.$el.data('rating-enabled');
message_data['rating_enabled'] = rating_enabled;
var $elem = this._super.call(this, message_data);
if(message_data['rating_enabled']){
if(message_data['rating_default_value']){
var rating_star = new rating.RatingStarWidget(this, {
'rating_default_value': message_data['rating_default_value'],
'rating_disabled': message_data['rating_disabled'],