diff options
| author | Sébastien Theys <seb@odoo.com> | 2018-08-28 11:58:52 +0200 |
|---|---|---|
| committer | Sébastien Theys <seb@odoo.com> | 2018-08-28 12:03:35 +0200 |
| commit | 1c59de867dd04ae7aa2b6625d4f1c5c877b7586f (patch) | |
| tree | 3386b83ea0bfb06b799401832316a7eb81d3cd0e /addons/web/static/tests/fields/relational_fields_tests.js | |
| parent | e2bc4d57c251c5862b64822a497097b98f3d61fe (diff) | |
[FIX] web: prevent handle from crashing with text field
289adeb63f51a9af26b8f383ba80089aa7aa6d87 introduced a bug where we tried to trigger an event on an element that didn't exist. Indeed there is no input if it's not in edit mode.
This commit fixes it.
PR: none
Task: none
Diffstat (limited to 'addons/web/static/tests/fields/relational_fields_tests.js')
| -rw-r--r-- | addons/web/static/tests/fields/relational_fields_tests.js | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/addons/web/static/tests/fields/relational_fields_tests.js b/addons/web/static/tests/fields/relational_fields_tests.js index 15499234c49..e5a0ad43a70 100644 --- a/addons/web/static/tests/fields/relational_fields_tests.js +++ b/addons/web/static/tests/fields/relational_fields_tests.js @@ -9491,7 +9491,7 @@ QUnit.module('relational_fields', { form.destroy(); }); - QUnit.test('one2many with sequence field, fetch name_get from empty list', function (assert) { + QUnit.test('one2many with sequence field, fetch name_get from empty list, field text', function (assert) { // There was a bug where a RPC would fail because no route was set. // The scenario is: // - create a new parent model, which has a one2many @@ -9501,6 +9501,11 @@ QUnit.module('relational_fields', { // - reorder the lines with the handle // -> This will call a resequence, which calls a name_get. // -> With the bug that would fail, if it's ok the test will pass. + + // This test will also make sure lists with + // FieldText (turtle_description) can be reordered with a handle. + // More specifically this will trigger a reset on a FieldText + // while the field is not in editable mode. assert.expect(4); this.data.turtle.fields.turtle_int.default = 10; @@ -9521,6 +9526,7 @@ QUnit.module('relational_fields', { '<field name="turtle_int" widget="handle"/>' + '<field name="turtle_foo"/>' + '<field name="not_required_product_id"/>' + + '<field name="turtle_description" widget="text"/>' + '</tree>' + '</field>' + '</form>', |
