diff options
| author | David Beguin <dbe@odoo.com> | 2019-09-30 13:37:35 +0000 |
|---|---|---|
| committer | David Beguin <dbe@odoo.com> | 2019-09-30 15:54:51 +0000 |
| commit | fed533bcf2385382d3f1fbf9af7ead3abaa53dc5 (patch) | |
| tree | 29dddea5dc2c4e6e8ebde16e2191eaf6e0e878cc /addons/website_livechat | |
| parent | c7d6fc84a8db667070febb2117007d42fb7a231c (diff) | |
[FIX] livechat : fix rating per user in livechat frontend view
rating_per_user was instanciated the wrong way, as all the key pointed to the
same reference. Once a value was modified in the value dict, all the other
values in rating_per_user were also updated.
Task ID: 2076656
PR #37511
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
Diffstat (limited to 'addons/website_livechat')
| -rw-r--r-- | addons/website_livechat/controllers/main.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/addons/website_livechat/controllers/main.py b/addons/website_livechat/controllers/main.py index 9fb4678d39e..f6a5b90fc0c 100644 --- a/addons/website_livechat/controllers/main.py +++ b/addons/website_livechat/controllers/main.py @@ -33,7 +33,8 @@ class WebsiteLivechat(http.Controller): percentage[grade] = round(repartition[grade] * 100.0 / sum(repartition.values()), 1) if sum(repartition.values()) else 0 # filter only on the team users that worked on the last 100 ratings and get their detailed stat - ratings_per_partner = dict.fromkeys(ratings.mapped('rated_partner_id.id'), dict.fromkeys(['great', 'okay', 'bad'], 0)) + 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'} |
