diff options
| author | Rohan Patel <rop@odoo.com> | 2017-03-27 15:18:21 +0200 |
|---|---|---|
| committer | Jérome Maes <jem@openerp.com> | 2017-07-10 08:49:22 +0200 |
| commit | cc6fc799a63456d451d9719799c4a63724acd841 (patch) | |
| tree | 9195a7ff55b932301a8d3a979e7a040eb7372364 /addons/im_livechat/controllers | |
| parent | 184e6f68c6d0d0cabd82f6918493931390098240 (diff) | |
[IMP] im_livechat: set the 'rater' partner
If user is logged (example: portal user), set the
partner_id on rating.
Diffstat (limited to 'addons/im_livechat/controllers')
| -rw-r--r-- | addons/im_livechat/controllers/main.py | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/addons/im_livechat/controllers/main.py b/addons/im_livechat/controllers/main.py index f033fc72cc7..35414321bed 100644 --- a/addons/im_livechat/controllers/main.py +++ b/addons/im_livechat/controllers/main.py @@ -98,6 +98,8 @@ class LivechatController(http.Controller): # find the partner (operator) if channel.channel_partner_ids: values['rated_partner_id'] = channel.channel_partner_ids[0] and channel.channel_partner_ids[0].id or False + # 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) else: |
