diff options
| author | Christophe Simonis <chs@odoo.com> | 2019-08-21 16:58:16 +0200 |
|---|---|---|
| committer | Christophe Simonis <chs@odoo.com> | 2019-08-21 16:58:16 +0200 |
| commit | 668c360e32b4130966eddc8ed28b6cb4e66055aa (patch) | |
| tree | 0e50e6458998b2e4ad029341600655586eb14929 /addons/im_livechat/controllers | |
| parent | 121034f79a6a4e57ed936c8672fc5f8472ca2cfd (diff) | |
| parent | 1b234b1be75e32f741b3e236a89ea854f0c186a5 (diff) | |
[MERGE] forward port branch 11.0 up to 1b234b1be75
Diffstat (limited to 'addons/im_livechat/controllers')
| -rw-r--r-- | addons/im_livechat/controllers/main.py | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/addons/im_livechat/controllers/main.py b/addons/im_livechat/controllers/main.py index 79a5f28b99b..381874903b9 100644 --- a/addons/im_livechat/controllers/main.py +++ b/addons/im_livechat/controllers/main.py @@ -80,7 +80,6 @@ class LivechatController(http.Controller): @http.route('/im_livechat/feedback', type='json', auth='public') def feedback(self, uuid, rate, reason=None, **kwargs): Channel = request.env['mail.channel'] - Rating = request.env['rating.rating'] channel = Channel.sudo().search([('uuid', '=', uuid)], limit=1) if channel: # limit the creation : only ONE rating per session @@ -101,7 +100,11 @@ class LivechatController(http.Controller): # if logged in user, set its partner on rating values['partner_id'] = request.env.user.partner_id.id if request.session.uid else False # create the rating - rating = Rating.sudo().create(values) + + channel.write({ + 'rating_ids': [(0, False, values)] + }) + rating = channel.rating_ids[0] else: rating = channel.rating_ids[0] rating.write(values) |
