[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>
This commit is contained in:
Mohammed Shekha
2020-03-13 11:30:33 +00:00
parent 190dab8144
commit 0c67b249a6
@@ -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;