diff options
| author | Aaron Bohy <aab@odoo.com> | 2021-02-04 14:04:13 +0000 |
|---|---|---|
| committer | Aaron Bohy <aab@odoo.com> | 2021-02-05 07:58:20 +0000 |
| commit | f2b9a5502f5cf0ee51f193177c679889c18130a9 (patch) | |
| tree | a2ff6a0c518aa8d04d5bd4384e4b6aa93b190e35 /addons/web/static/tests/fields | |
| parent | 125e5401123d8e4bc7656ac7534cc9290451adbc (diff) | |
[FIX] web: nested x2many with non inline views
This commit partially reverts commit [1], and backports commit
[2] from 14.0.
Even though [1] correctly fixes the faulty scenario, there is a
variation of this scenario which isn't handled. It has been
fixed in 14.0 by [2], and that fix also fixes the original
issue of [1]. So we keep the tests of both [1] and [2], and
the fix of [2].
[1] dd97d446ee94a32089f200bb7122139d31e69873
[2] f6c06bd0b87dac11d76a3134eb61c7ef4eb59270
closes odoo/odoo#65562
X-original-commit: 63c60549ef5185f5ec61dc985f0bcc2cb82ccc89
Signed-off-by: Géry Debongnie (ged) <ged@openerp.com>
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Diffstat (limited to 'addons/web/static/tests/fields')
| -rw-r--r-- | addons/web/static/tests/fields/relational_fields/field_one2many_tests.js | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/addons/web/static/tests/fields/relational_fields/field_one2many_tests.js b/addons/web/static/tests/fields/relational_fields/field_one2many_tests.js index c10fede6f7b..2f74ee4670b 100644 --- a/addons/web/static/tests/fields/relational_fields/field_one2many_tests.js +++ b/addons/web/static/tests/fields/relational_fields/field_one2many_tests.js @@ -7284,6 +7284,36 @@ QUnit.module('fields', {}, function () { form.destroy(); }); + QUnit.test('nested one2manys with no widget in list and as invisible list in form', async function (assert) { + assert.expect(4); + + this.data.partner.records[0].p = [1]; + + const form = await createView({ + View: FormView, + model: 'partner', + data: this.data, + arch: ` + <form> + <field name="p"> + <tree><field name="turtles"/></tree> + <form><field name="turtles" invisible="1"/></form> + </field> + </form>`, + res_id: 1, + }); + + assert.containsOnce(form, '.o_data_row'); + assert.strictEqual(form.$('.o_data_row .o_data_cell').text(), '1 record'); + + await testUtils.dom.click(form.$('.o_data_row')); + + assert.containsOnce(document.body, '.modal .o_form_view'); + assert.containsNone(document.body, '.modal .o_form_view .o_field_one2many'); + + form.destroy(); + }); + QUnit.test('onchange on nested one2manys', async function (assert) { assert.expect(6); |
