diff options
| author | Christophe Simonis <chs@odoo.com> | 2019-03-14 14:13:47 +0100 |
|---|---|---|
| committer | Christophe Simonis <chs@odoo.com> | 2019-03-14 14:13:47 +0100 |
| commit | 9a4e84ae6670a6ce7086174a3f33f2eee8ded0a3 (patch) | |
| tree | 6a89fa5e6afe9120abda03cfbd32e27cf6cf4768 /addons/web/static/tests/fields | |
| parent | 5625257991d8997c453aee26b5f05ef85925824e (diff) | |
| parent | f5ab04ce5098bb3c3e88ca18ba6b533e6139f8e5 (diff) | |
[MERGE] forward port branch saas-11.3 up to f5ab04ce509
Diffstat (limited to 'addons/web/static/tests/fields')
| -rw-r--r-- | addons/web/static/tests/fields/relational_fields_tests.js | 37 |
1 files changed, 37 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 640e02701c2..bae181fa7a6 100644 --- a/addons/web/static/tests/fields/relational_fields_tests.js +++ b/addons/web/static/tests/fields/relational_fields_tests.js @@ -3596,6 +3596,43 @@ QUnit.module('relational_fields', { form.destroy(); }); + QUnit.test('embedded readonly one2many with handle widget', function (assert) { + assert.expect(4); + + this.data.partner.records[0].turtles = [1, 2, 3]; + + var form = createView({ + View: FormView, + model: 'partner', + data: this.data, + arch:'<form string="Partners">' + + '<sheet>' + + '<field name="turtles" readonly="1">' + + '<tree editable="top">' + + '<field name="turtle_int" widget="handle"/>' + + '<field name="turtle_foo"/>' + + '</tree>' + + '</field>' + + '</sheet>' + + '</form>', + res_id: 1, + }); + + assert.strictEqual(form.$('.o_row_handle').length, 3, + "there should be 3 handles (one for each row)"); + assert.strictEqual(form.$('.o_row_handle:visible').length, 0, + "the handles should be hidden in readonly mode"); + + form.$buttons.find('.o_form_button_edit').click(); + + assert.strictEqual(form.$('.o_row_handle').length, 3, + "the handles should still be there"); + assert.strictEqual(form.$('.o_row_handle:visible').length, 0, + "the handles should still be hidden (on readonly fields)"); + + form.destroy(); + }); + QUnit.test('onchange for embedded one2many in a one2many with a second page', function (assert) { assert.expect(1); |
