From 91637fd0cf2faead7cdb6848ef1fec107f98bea5 Mon Sep 17 00:00:00 2001 From: Alexis de Lattre Date: Fri, 15 Mar 2019 18:47:22 +0100 Subject: [PATCH] Improve style of Dial button Improve messages in notification pop-up Fix short disconnect upon click2dial Add active button for asterisk.server form view Fix add call in CRM wizard --- .../static/src/js/asterisk_click2dial.js | 13 ++++++------- asterisk_click2dial/views/asterisk_server.xml | 10 +++++++++- base_phone/static/src/js/phone_widget.js | 9 ++++----- crm_phone/wizard/create_crm_phonecall.py | 5 +---- 4 files changed, 20 insertions(+), 17 deletions(-) diff --git a/asterisk_click2dial/static/src/js/asterisk_click2dial.js b/asterisk_click2dial/static/src/js/asterisk_click2dial.js index 1d41dd4..1f6c12e 100644 --- a/asterisk_click2dial/static/src/js/asterisk_click2dial.js +++ b/asterisk_click2dial/static/src/js/asterisk_click2dial.js @@ -7,7 +7,6 @@ odoo.define('asterisk_click2dial.systray.OpenCaller', function (require) { var core = require('web.core'); var SystrayMenu = require('web.SystrayMenu'); -var web_client = require('web.web_client'); var Widget = require('web.Widget'); var _t = core._t; @@ -42,8 +41,8 @@ var OpenCallerMenu = Widget.extend({ // console.log('RESULT RPC isNaN r='+isNaN(r)); if (r === false) { self.do_warn( - _t('Failure'), - _t('Problem in the connection to Asterisk'), + _t('IPBX error'), + _t('Calling party number not retreived from IPBX or IPBX unreachable by Odoo'), false); } else if (typeof r == 'string' && isNaN(r)) { @@ -62,13 +61,13 @@ var OpenCallerMenu = Widget.extend({ target: 'new', context: {'default_calling_number': r}, }; - web_client.action_manager.do_action(action); + self.do_action(action); } else if (typeof r == 'object' && r.length == 3) { self.do_notify( - _t('Success'), - _.str.sprintf(_t('Moving to %s ID %d'), r[0], r[1]), + _.str.sprintf(_t("On the phone with '%s'"), r[2]), + _.str.sprintf(_t("Moving to form view of '%s' (%s ID %d)"), r[2], r[0], r[1]), false); var action = { type: 'ir.actions.act_window', @@ -86,7 +85,7 @@ var OpenCallerMenu = Widget.extend({ target: 'current', context: {}, }; - web_client.action_manager.do_action(action); + self.do_action(action); } }); }, diff --git a/asterisk_click2dial/views/asterisk_server.xml b/asterisk_click2dial/views/asterisk_server.xml index 246d838..d7305bc 100644 --- a/asterisk_click2dial/views/asterisk_server.xml +++ b/asterisk_click2dial/views/asterisk_server.xml @@ -14,6 +14,8 @@ + + @@ -24,6 +26,13 @@
+
+ +