[FIX] im_livechat, website_livechat: fix rating values

Rating values have been reviewed to be between 1 and 5 but not in livechat apps.
This commit align rating values.

Task ID-2301261
PR odoo/odoo#60549

X-original-commit: ed408d45e8d35eff94a73e37183cbf2e91833f15
This commit is contained in:
David Beguin
2021-03-29 11:17:48 +00:00
committed by Thibault Delavallée
parent 2d715d381c
commit a7b3003f9f
2 changed files with 3 additions and 2 deletions
+1 -1
View File
@@ -248,7 +248,7 @@ class RatingMixin(models.AbstractModel):
for key in data:
if key >= RATING_LIMIT_SATISFIED:
res['great'] += data[key]
elif key > RATING_LIMIT_OK:
elif key >= RATING_LIMIT_OK:
res['okay'] += data[key]
else:
res['bad'] += data[key]
+2 -1
View File
@@ -36,7 +36,8 @@ class WebsiteLivechat(LivechatController):
ratings_per_partner = {partner_id: dict(great=0, okay=0, bad=0)
for partner_id in ratings.mapped('rated_partner_id.id')}
total_ratings_per_partner = dict.fromkeys(ratings.mapped('rated_partner_id.id'), 0)
rating_texts = {10: 'great', 5: 'okay', 1: 'bad'}
# keep 10 for backward compatibility
rating_texts = {10: 'great', 5: 'great', 3: 'okay', 1: 'bad'}
for rating in ratings:
partner_id = rating.rated_partner_id.id