Skip to content
Permalink
Browse files

[FIX] website_livechat: fix error when no ratings

- if there is no ratting for user, it will throw error while publishing channel.
- so, here we check if there is any rating for particular user or not.

Related to Issue: 1966384
  • Loading branch information...
pka-odoo committed Apr 9, 2019
1 parent 7887dd8 commit 8cb214b234959aeffc99d0d37d7c5f781f77cff2
Showing with 15 additions and 13 deletions.
  1. +15 −13 addons/website_livechat/views/website_livechat.xml
@@ -167,19 +167,21 @@
</h5>
<div class="col-lg-12">
<div class="row">
<div class="col-lg-4 pl-0 pr-0">
<img t-attf-src='/rating/static/src/img/rating_10.png' alt="Great" width="16px" height="16px"/>
<span class="align-middle"><t t-esc="ratings_per_user[user.partner_id.id]['great']"/>%</span>
</div>
<div class="col-lg-4 pl-0 pr-0">
<img t-attf-src='/rating/static/src/img/rating_5.png' alt="Okay" width="16px" height="16px"/>
<span class="align-middle"><t t-esc="ratings_per_user[user.partner_id.id]['okay']"/>%</span>
</div>
<div class="col-lg-4 pl-0 pr-0">
<img t-attf-src='/rating/static/src/img/rating_1.png' alt="Bad" width="16px" height="16px"/>
<span class="align-middle"><t t-esc="ratings_per_user[user.partner_id.id]['bad']"/>%</span>
</div>
<t t-if="user.partner_id.id not in ratings_per_user">
<t t-if="user.partner_id.id in ratings_per_user">
<div class="col-lg-4 pl-0 pr-0">
<img t-attf-src='/rating/static/src/img/rating_10.png' alt="Great" width="16px" height="16px"/>
<span class="align-middle"><t t-esc="ratings_per_user[user.partner_id.id]['great']"/>%</span>
</div>
<div class="col-lg-4 pl-0 pr-0">
<img t-attf-src='/rating/static/src/img/rating_5.png' alt="Okay" width="16px" height="16px"/>
<span class="align-middle"><t t-esc="ratings_per_user[user.partner_id.id]['okay']"/>%</span>
</div>
<div class="col-lg-4 pl-0 pr-0">
<img t-attf-src='/rating/static/src/img/rating_1.png' alt="Bad" width="16px" height="16px"/>
<span class="align-middle"><t t-esc="ratings_per_user[user.partner_id.id]['bad']"/>%</span>
</div>
</t>
<t t-else="">
<div class="col-lg-12 pl-0 pr-0 o_livechat_no_rating">Not rated yet</div>
</t>
</div>

0 comments on commit 8cb214b

Please sign in to comment.
You can’t perform that action at this time.