diff options
| author | Martin Geubelle <mge@odoo.com> | 2018-04-11 17:19:45 +0200 |
|---|---|---|
| committer | Martin Geubelle <mge@odoo.com> | 2018-04-17 15:31:32 +0200 |
| commit | 9e6c616130622eabc5a43f84eca80c6326ded20b (patch) | |
| tree | 33dfda4c15e5603059dfb775c5efb03f449eb812 /addons/web/static/tests/fields | |
| parent | df02dc37fd2febd3fc899792ee25c80c0149d255 (diff) | |
[FIX] web: focus select in reference widget
In the reference widget, the focus was always on the input (many2one) even
though the first select (with the model) was not set.
Thanks to @kaerdsar for the original PR.
Partially closes #24070
Diffstat (limited to 'addons/web/static/tests/fields')
| -rw-r--r-- | addons/web/static/tests/fields/relational_fields_tests.js | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/addons/web/static/tests/fields/relational_fields_tests.js b/addons/web/static/tests/fields/relational_fields_tests.js index b855f827c97..b28ddfafb0a 100644 --- a/addons/web/static/tests/fields/relational_fields_tests.js +++ b/addons/web/static/tests/fields/relational_fields_tests.js @@ -11298,6 +11298,32 @@ QUnit.module('relational_fields', { form.destroy(); }); + QUnit.test('reference and list navigation', function (assert) { + assert.expect(2); + + var list = createView({ + View: ListView, + model: 'partner', + data: this.data, + arch: '<tree editable="bottom"><field name="reference"/></tree>', + }); + + // edit first row + list.$('.o_data_row .o_data_cell').first().click(); + assert.strictEqual(list.$('.o_data_row:eq(0) .o_field_widget[name="reference"] input')[0], document.activeElement, + 'input of first data row should be selected'); + + // press TAB to go to next line + list.$('.o_data_row:eq(0) input').trigger($.Event('keydown', { + which: $.ui.keyCode.TAB, + keyCode: $.ui.keyCode.TAB, + })); + assert.strictEqual(list.$('.o_data_row:eq(1) .o_field_widget[name="reference"] select')[0], document.activeElement, + 'select of second data row should be selected'); + + list.destroy(); + }); + QUnit.test('one2many with extra field from server not in form', function (assert) { assert.expect(6); |
