From 75f7ab0608bfb9770e99fe2ce1ad55e76c70ac72 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Debauche=20St=C3=A9phane?= Date: Mon, 20 Jan 2020 14:28:35 +0000 Subject: [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 --- addons/web/static/src/js/fields/basic_fields.js | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'addons/web/static/src/js/fields/basic_fields.js') 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(''); + } }, //-------------------------------------------------------------------------- -- cgit v1.2.3