summaryrefslogtreecommitdiff
path: root/addons/website_crm_livechat
diff options
context:
space:
mode:
authorDavid Beguin <dbe@odoo.com>2019-11-28 16:03:08 +0000
committerThibault Delavallée <tde@odoo.com>2020-02-10 11:46:05 +0000
commit9c9032e664fa2e5f53c7978dc17f8f18dc8ad9a6 (patch)
treeae00940f3942512bb06d3a07deddce255e9e6f30 /addons/website_crm_livechat
parent5a3c4f074281e0aa0e2eff0e623ac7f9b7925a33 (diff)
[IMP] (im/website)_livechat : hide and clean empty livechat sessions
Purpose ======= Whenever a visitor start a livechat session but finally close the session without sending any messages, the livechat session is empty and stay in DB. Livechat session counter counts all the sessions (with and without message) but when opening the sessions tree view, the view is filtered by default on session with messages. There is no reason to see the empty sessions as it does not give any information (except "the visitor hesitated to start livechat and finally did not" which is quite useless info) The goal is to keep only sessions with messages. When the visitor is closing the livechat window, if the session is empty, the session should be deleted. But what happens if a visitor start a livechat session, send no message and just leave the website without closing the livechat window ? --> empty live chat session will remains in database. The ir_autovacuum already handle the deletion of empty sessions to main a clean DB. Specifications ============== - Apply 'with messages' domain on session count in the livechat channel view - Apply 'with messages' domain on session count in the lead view - Apply 'with messages' domain on livechat session view - Remove With message filter - Remove Without message filter - If send message on a deleted session : just tell the visitor that operator is not available anymore AND delete livechat session cookie (as he waited 1 day to send a message) Empty sessions becomes invisible : not possible for users to see empty session (in count or in views) and cron is cleaning empty sessions every day. This commit also adapts visitor session count and view accordingly. Task ID: 2146962 PR #41065 Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
Diffstat (limited to 'addons/website_crm_livechat')
-rw-r--r--addons/website_crm_livechat/models/crm_lead.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/addons/website_crm_livechat/models/crm_lead.py b/addons/website_crm_livechat/models/crm_lead.py
index b28dcaf7f1e..1b31eaa3a3f 100644
--- a/addons/website_crm_livechat/models/crm_lead.py
+++ b/addons/website_crm_livechat/models/crm_lead.py
@@ -17,5 +17,5 @@ class Lead(models.Model):
def action_redirect_to_livechat_sessions(self):
visitors = self.visitor_ids
action = self.env.ref('website_livechat.website_visitor_livechat_session_action').read()[0]
- action['domain'] = [('livechat_visitor_id', 'in', visitors.ids)]
+ action['domain'] = [('livechat_visitor_id', 'in', visitors.ids), ('channel_message_ids', '!=', False)]
return action