diff options
| author | Nasreddin (bon) <bon@odoo.com> | 2020-11-02 10:40:28 +0000 |
|---|---|---|
| committer | Nasreddin (bon) <bon@odoo.com> | 2020-11-02 10:49:42 +0000 |
| commit | e2e1ecd0de467cb97748092554c5abc3b0c9f993 (patch) | |
| tree | 0e63913e93f5e3aeeeaa5c075a789370ad5c1d32 /addons/rating | |
| parent | 5927fc1304215d1f987d6e4fc3e9e2f3c2e44ee3 (diff) | |
[FIX] portal_rating, rating: Wrong star rating number
Issue
- Install 'eLearning' module
- Go to 'Course' page on website
- Open any course and click on 'Review' tab
Rating star numbers are 2,4,6,8 & 10.
Cause
Since this commit https://github.com/odoo/odoo/commit/e4a4ffb974ccde1842e1b2389450718f8576ad5b,
odoo use a system of 5 stars instead of 10.
opw-2373115
closes odoo/odoo#61130
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
Diffstat (limited to 'addons/rating')
| -rw-r--r-- | addons/rating/models/rating_mixin.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/addons/rating/models/rating_mixin.py b/addons/rating/models/rating_mixin.py index 3886f8b812e..6825083554e 100644 --- a/addons/rating/models/rating_mixin.py +++ b/addons/rating/models/rating_mixin.py @@ -266,7 +266,7 @@ class RatingMixin(models.AbstractModel): result = { 'avg': data['avg'], 'total': data['total'], - 'percent': dict.fromkeys(range(1, 11), 0), + 'percent': dict.fromkeys(range(1, 6), 0), } for rate in data['repartition']: result['percent'][rate] = (data['repartition'][rate] * 100) / data['total'] if data['total'] > 0 else 0 |
