diff options
Diffstat (limited to 'addons/web/static/tests/views')
| -rw-r--r-- | addons/web/static/tests/views/basic_model_tests.js | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/addons/web/static/tests/views/basic_model_tests.js b/addons/web/static/tests/views/basic_model_tests.js index 909cdfaa905..dd802790210 100644 --- a/addons/web/static/tests/views/basic_model_tests.js +++ b/addons/web/static/tests/views/basic_model_tests.js @@ -127,6 +127,42 @@ odoo.define('web.basic_model_tests', function (require) { form.destroy(); }); + QUnit.test('can process x2many commands (with multiple fields)', async function (assert) { + assert.expect(1); + + this.data.partner.fields.product_ids.default = [[0, 0, { category: [] }]]; + + const form = await createView({ + View: FormView, + model: 'partner', + data: this.data, + arch: ` + <form> + <field name="product_ids"/> + </form> + `, + archs: { + 'product,false,list': ` + <tree> + <field name="display_name"/> + <field name="active"/> + </tree> + `, + }, + mockRPC(route, args) { + if (args.method === "create") { + const product_ids = args.args[0].product_ids; + const values = product_ids[0][2]; + assert.strictEqual(values.active, true, "active field should be set"); + } + return this._super.apply(this, arguments); + }, + }); + + await testUtils.form.clickSave(form); + form.destroy(); + }); + QUnit.test('can load a record', async function (assert) { assert.expect(7); |
