From e64762e535504a82c5a55615b9a3e17dbf7ac562 Mon Sep 17 00:00:00 2001 From: "Lucas Perais (lpe)" Date: Wed, 20 Sep 2017 14:23:27 +0200 Subject: [FIX] web, google_drive: fixed display of field link Before this commit, a field handled with a widget url was given its value (href) as its text, fully displaying the url. Moreover, the display was odd and did not match that of buttons After this commit, if the field contains a text attribute, we use is as the text of the link. The link also correctly displays and looks like a button (in a form view) Of course, a test for this new field widget feature is implemented closes #19587 --- addons/web/static/src/js/fields/basic_fields.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (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 dc4887eacc7..1139b234edd 100644 --- a/addons/web/static/src/js/fields/basic_fields.js +++ b/addons/web/static/src/js/fields/basic_fields.js @@ -1049,7 +1049,7 @@ var UrlWidget = InputField.extend({ * @private */ _renderReadonly: function () { - this.$el.text(this.value) + this.$el.text(this.attrs.text || this.value) .addClass('o_form_uri o_text_overflow') .attr('href', this.value); } -- cgit v1.2.3