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/tests/fields/basic_fields_tests.js | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'addons/web/static/tests/fields/basic_fields_tests.js') diff --git a/addons/web/static/tests/fields/basic_fields_tests.js b/addons/web/static/tests/fields/basic_fields_tests.js index 91029cf9cfc..8560354c760 100644 --- a/addons/web/static/tests/fields/basic_fields_tests.js +++ b/addons/web/static/tests/fields/basic_fields_tests.js @@ -1040,6 +1040,24 @@ QUnit.module('basic_fields', { form.destroy(); }); + QUnit.test('url widget takes text from proper attribute', function (assert) { + assert.expect(1); + + var form = createView({ + View: FormView, + model: 'partner', + data: this.data, + arch:'
' + + '' + + '', + res_id: 1, + }); + + assert.strictEqual(form.$('a[name="foo"]').text(), 'kebeclibre', + "url text should come from the text attribute"); + form.destroy(); + }); + QUnit.test('char field in editable list view', function (assert) { assert.expect(10); -- cgit v1.2.3