summaryrefslogtreecommitdiff
path: root/addons/sms/static/src/js/fields_phone_widget.js
diff options
context:
space:
mode:
authorMohammed Shekha <msh@odoo.com>2020-01-03 12:03:05 +0000
committerMohammed Shekha <msh@odoo.com>2020-03-13 11:30:33 +0000
commit0c67b249a6427ebf16903741b37fac98ace1af4d (patch)
tree56a1e744453bc63698fe0e107987f4f2c886d4d3 /addons/sms/static/src/js/fields_phone_widget.js
parent190dab8144b5dd46bb2492093d0d8d3abafb19b4 (diff)
[IMP] sms: do not wrap phone widget element in div
if we wrap phone widget element inside div then phone link will be clickable inside studio mode, as soon as user tries to click on phone text phone call will be trigerred, which is wrong in studio edition mode. if studio edition mode is enable then clicking on phone text should not trigger call, we already handle click in readonly mode on widget's in form_editor.js -> _processField method but in phone widget sms module changes of phone widget and wrap it into div which makes phone text and sms icon clickable and trigger phone call, to avoid this case remove wrapping of widget inside div. task-2118509 closes odoo/odoo#42685 Signed-off-by: Damien Bouvy (dbo) <dbo@odoo.com>
Diffstat (limited to 'addons/sms/static/src/js/fields_phone_widget.js')
-rw-r--r--addons/sms/static/src/js/fields_phone_widget.js4
1 files changed, 2 insertions, 2 deletions
diff --git a/addons/sms/static/src/js/fields_phone_widget.js b/addons/sms/static/src/js/fields_phone_widget.js
index 84809f2b044..82b8e5b3f7f 100644
--- a/addons/sms/static/src/js/fields_phone_widget.js
+++ b/addons/sms/static/src/js/fields_phone_widget.js
@@ -33,7 +33,7 @@ Phone.include({
*/
getFocusableElement() {
if (this.enableSMS && this.mode === 'readonly') {
- return this.$('.' + this.className);
+ return this.$el.filter('.' + this.className);
}
return this._super.apply(this, arguments);
},
@@ -88,7 +88,7 @@ Phone.include({
});
$composerButton.prepend($('<i>', {class: 'fa fa-mobile'}));
$composerButton.on('click', this._onClickSMS.bind(this));
- this.$el = $('<div/>').append(this.$el).append($composerButton);
+ this.$el = this.$el.add($composerButton);
}
return def;