From 587ed5df5b542c6c6b3f13d1e348dd28d0da1f2c Mon Sep 17 00:00:00 2001 From: Priyanka Kakadiya Date: Fri, 6 Nov 2020 06:03:57 +0000 Subject: [FIX] hr: fix error on double click of chat user name MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit PURPOSE When opening the same form view 2 times in quick succession (e.g. clicking twice on the name of an employee from a chat window), there is a traceback SPECIFICATION It should open public employee form and not raise any error LINKS Task-2371687 PR https://github.com/odoo/odoo/pull/61457 closes odoo/odoo#61457 Signed-off-by: Sébastien Theys (seb) --- addons/hr/static/src/js/chat.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/addons/hr/static/src/js/chat.js b/addons/hr/static/src/js/chat.js index 0489ccceac0..9bae9d57d41 100644 --- a/addons/hr/static/src/js/chat.js +++ b/addons/hr/static/src/js/chat.js @@ -27,7 +27,9 @@ odoo.define('hr.employee_chat', function (require) { }, destroy: function () { - this.$el.find('.o_employee_chat_btn').off('click'); + if (this.$el) { + this.$el.find('.o_employee_chat_btn').off('click'); + } return this._super(); }, -- cgit v1.2.3