[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
This commit is contained in:
Lucas Perais (lpe)
2017-09-26 09:37:16 +02:00
parent b4824d78eb
commit e64762e535
4 changed files with 32 additions and 4 deletions
@@ -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);
}