diff options
| author | Debauche Stéphane <std@odoo.com> | 2020-01-20 14:28:35 +0000 |
|---|---|---|
| committer | Thibault Delavallée <tde@odoo.com> | 2020-01-28 09:14:43 +0000 |
| commit | 75f7ab0608bfb9770e99fe2ce1ad55e76c70ac72 (patch) | |
| tree | 16654596a1fc75b24e71c56f56d27a65b96f5739 /addons/web/static/src/js/fields | |
| parent | 1ec887b773581b6316902997fec94176bbae1ac0 (diff) | |
[FIX] web: fix email and phone widgets with empty value
When the value is empty in a related field, string of the element was
displaying "false" instead of an empty string which is not what we expect.
This commit fixes that issue.
Task ID 2119333
PR #40949
Diffstat (limited to 'addons/web/static/src/js/fields')
| -rw-r--r-- | addons/web/static/src/js/fields/basic_fields.js | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/addons/web/static/src/js/fields/basic_fields.js b/addons/web/static/src/js/fields/basic_fields.js index 3be9b68cd0d..0d1fc77737f 100644 --- a/addons/web/static/src/js/fields/basic_fields.js +++ b/addons/web/static/src/js/fields/basic_fields.js @@ -1465,9 +1465,13 @@ var FieldEmail = InputField.extend({ * @private */ _renderReadonly: function () { - this.$el.text(this.value) - .addClass('o_form_uri o_text_overflow') - .attr('href', this.prefix + ':' + this.value); + if (this.value) { + this.$el.text(this.value) + .addClass('o_form_uri o_text_overflow') + .attr('href', this.prefix + ':' + this.value); + } else { + this.$el.text(''); + } }, //-------------------------------------------------------------------------- |
