From ef6074beb637fbb20b56f76838a4bc22226b62cb Mon Sep 17 00:00:00 2001 From: fwi-odoo Date: Thu, 7 Sep 2017 10:40:39 +0200 Subject: [PATCH] [FIX] web: fix x2m tests When a x2m field is modified, the 'save' rpc doesn't send 'False' as second argument of the special command that manipulate the set of records. From now on, the virtual id of the record is sent to the server as second argument. This commit fixes the tests making the assumption that 'False' was sent. --- .../web/static/tests/fields/relational_fields_tests.js | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/addons/web/static/tests/fields/relational_fields_tests.js b/addons/web/static/tests/fields/relational_fields_tests.js index 5dc17e6fb59..5451629a3ed 100644 --- a/addons/web/static/tests/fields/relational_fields_tests.js +++ b/addons/web/static/tests/fields/relational_fields_tests.js @@ -5539,7 +5539,7 @@ QUnit.module('relational_fields', { QUnit.test('editing tabbed one2many (editable=bottom)', function (assert) { - assert.expect(11); + assert.expect(12); this.data.partner.records[0].turtles = []; for (var i = 0; i < 42; i++) { @@ -5565,7 +5565,8 @@ QUnit.module('relational_fields', { mockRPC: function (route, args) { assert.step(args.method); if (args.method === 'write') { - assert.deepEqual(args.args[1].turtles[42], [0, false, {turtle_foo: 'rainbow dash'}]); + assert.strictEqual(args.args[1].turtles[42][0], 0); + assert.deepEqual(args.args[1].turtles[42][2], {turtle_foo: 'rainbow dash'}); } return this._super.apply(this, arguments); }, @@ -5591,7 +5592,7 @@ QUnit.module('relational_fields', { }); QUnit.test('editing tabbed one2many (editable=top)', function (assert) { - assert.expect(14); + assert.expect(15); this.data.partner.records[0].turtles = []; this.data.turtle.fields.turtle_foo.default = "default foo"; @@ -5618,7 +5619,8 @@ QUnit.module('relational_fields', { mockRPC: function (route, args) { assert.step(args.method); if (args.method === 'write') { - assert.deepEqual(args.args[1].turtles[0], [0, false, {turtle_foo: 'rainbow dash'}]) + assert.strictEqual(args.args[1].turtles[0][0], 0); + assert.deepEqual(args.args[1].turtles[0][2], {turtle_foo: 'rainbow dash'}); } return this._super.apply(this, arguments); },