From bb10cd50c28f224146634365ac341de6e09644d3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Bidoul=20=28ACSONE=29?= Date: Sun, 31 Dec 2017 15:43:49 +0100 Subject: [FIX] web: issue with id field in x2m form When the 'id' field is present in a x2m form, the x2m actions generated on create of the parent object are incorrect. --- .../static/tests/fields/relational_fields_tests.js | 31 ++++++++++++++++++++++ 1 file changed, 31 insertions(+) (limited to 'addons/web/static/tests/fields/relational_fields_tests.js') diff --git a/addons/web/static/tests/fields/relational_fields_tests.js b/addons/web/static/tests/fields/relational_fields_tests.js index 757c4c20278..88db9166bdb 100644 --- a/addons/web/static/tests/fields/relational_fields_tests.js +++ b/addons/web/static/tests/fields/relational_fields_tests.js @@ -4832,6 +4832,37 @@ QUnit.module('relational_fields', { form.destroy(); }); + QUnit.test('id field in one2many in a new record', function (assert) { + assert.expect(1); + + var form = createView({ + View: FormView, + model: 'partner', + data: this.data, + arch: '
' + + '' + + '' + + '' + + '' + + '' + + '' + + '
', + mockRPC: function (route, args) { + if (args.method === 'create') { + assert.deepEqual(args.args[0].turtles, + [[0, false, {turtle_foo: "cat"}]], + 'should send proper commands'); + } + return this._super.apply(this, arguments); + }, + }); + form.$('td.o_field_x2many_list_row_add a').click(); + form.$('td input[name="turtle_foo"]').val('cat').trigger('input'); + form.$buttons.find('.o_form_button_save').click(); + + form.destroy(); + }); + QUnit.test('sub form view with a required field', function (assert) { assert.expect(2); this.data.partner.fields.foo.required = true; -- cgit v1.2.3 From 1efc9d0b5eb9b256c5c0e4d10c920d11c757ae7f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=A9ry=20Debongnie?= Date: Fri, 5 Jan 2018 10:07:35 +0100 Subject: [FIX] web: transfer attributes to subnodes in list views In many cases, we allow class and style attributes in the arch of a view. However, it did not work in a list view, and there is not really a good reason for that (only cost is a few runtime checks). So, with this commit, we allow those attributes in list views (and x2manys obviously). However, note that there is a subtle (maybe slightly confusing) behavior: when a list renderer is in 'readonly' mode, it does not actually instantiate any field widgets. In that case, it optimizes the rendering by putting only the formatted value inside a cell: some value So, in that case, the only valid target for the attributes is the td: some value But when we are in edit mode, we actually have a field widget inside a td: some value And in that case, the natural home for the attributes is the field widget. This is quite important, because this is the way attributes are done in the form view, and we do not want different behaviour. some value --- .../static/tests/fields/relational_fields_tests.js | 33 ++++++++++++++++++++++ 1 file changed, 33 insertions(+) (limited to 'addons/web/static/tests/fields/relational_fields_tests.js') diff --git a/addons/web/static/tests/fields/relational_fields_tests.js b/addons/web/static/tests/fields/relational_fields_tests.js index fc83a26b6b0..505d0e0571e 100644 --- a/addons/web/static/tests/fields/relational_fields_tests.js +++ b/addons/web/static/tests/fields/relational_fields_tests.js @@ -2081,6 +2081,39 @@ QUnit.module('relational_fields', { form.destroy(); }); + QUnit.test('transferring class attributes in one2many sub fields', function (assert) { + assert.expect(3); + + var form = createView({ + View: FormView, + model: 'partner', + data: this.data, + arch:'
' + + '' + + '' + + '' + + '' + + '' + + '
', + res_id: 1, + }); + + assert.strictEqual(form.$('td.hey').length, 1, + 'should have a td with the desired class'); + + form.$buttons.find('.o_form_button_edit').click(); + + assert.strictEqual(form.$('td.hey').length, 1, + 'should have a td with the desired class'); + + form.$('td.o_data_cell').click(); + + assert.strictEqual(form.$('input[name="turtle_foo"].hey').length, 1, + 'should have an input with the desired class'); + + form.destroy(); + }); + QUnit.test('one2many with date and datetime', function (assert) { assert.expect(2); -- cgit v1.2.3 From b7ee1aa4b1ea906195c234020cb708a1da9de6a7 Mon Sep 17 00:00:00 2001 From: Christophe Matthieu Date: Wed, 6 Dec 2017 10:09:02 +0100 Subject: [FIX] web: sort and onchange in tabbed editable x2m Two attempts of dealing with sorting (and resequencing) in tabbed (multi-pages) x2many editable lists (see odoo/odoo@c2563db and odoo/odoo@983c7ae) have been previously done, using a static attribute (`keepChangesUnsorted`) on the datapoint. This solution sadly only covers both cases separately, not if they are combined. Morever, onchanges were not correctly managed in neither of these two cases. A new approach is used here, by "freezing" and "unfreezing" the datapoint when needed, which is more flexible. Some modifications have been introduced: - when ordering a x2many, all records are now considered (and not only the records on the current page) ; an additional read is thus done on the sorted field for all records in the x2many relation - `setSort` is now asynchronous as a `read` might be needed --- .../static/tests/fields/relational_fields_tests.js | 175 +++++++++++++++++++-- 1 file changed, 160 insertions(+), 15 deletions(-) (limited to 'addons/web/static/tests/fields/relational_fields_tests.js') diff --git a/addons/web/static/tests/fields/relational_fields_tests.js b/addons/web/static/tests/fields/relational_fields_tests.js index 505d0e0571e..208f00298d3 100644 --- a/addons/web/static/tests/fields/relational_fields_tests.js +++ b/addons/web/static/tests/fields/relational_fields_tests.js @@ -2271,7 +2271,7 @@ QUnit.module('relational_fields', { }); QUnit.test('embedded one2many with handle widget', function (assert) { - assert.expect(7); + assert.expect(8); this.data.partner.records[0].turtles = [1, 2, 3]; @@ -2321,6 +2321,15 @@ QUnit.module('relational_fields', { "should have the 3 rows in the new order"); form.$buttons.find('.o_form_button_save').click(); + + assert.deepEqual(_.map(this.data.turtle.records, function(turtle) { + return _.pick(turtle, 'id', 'turtle_foo', 'turtle_int'); + }), [ + {id: 1, turtle_foo: "yop", turtle_int: 1}, + {id: 2, turtle_foo: "blip", turtle_int:0}, + {id: 3, turtle_foo: "kawa", turtle_int:21} + ], "should have save the changed sequence"); + assert.strictEqual(form.$('td.o_data_cell:not(.o_handle_cell)').text(), "blipyopkawa", "should still have the 3 rows in the new order"); @@ -2415,7 +2424,7 @@ QUnit.module('relational_fields', { res_id: 1, mockRPC: function (route, args) { if (args.method === 'write') { - assert.deepEqual(args.args[1].turtles, [[1,1,{"turtle_int":2}],[4,2,false],[1,3,{"turtle_int":3}]], + assert.deepEqual(args.args[1].turtles, [[4,2,false],[1,1,{"turtle_int":2}],[1,3,{"turtle_int":3}]], "should change all lines that have changed (the first one doesn't change because it has the same sequence)"); } return this._super.apply(this, arguments); @@ -2444,9 +2453,20 @@ QUnit.module('relational_fields', { }); QUnit.test('onchange (with command 5) for embedded one2many with handle widget', function (assert) { - assert.expect(2); + assert.expect(3); - this.data.partner.records[0].turtles = [1, 2, 3]; + var ids = []; + for (var i=10; i<50; i++) { + var id = 10 + i; + ids.push(id); + this.data.turtle.records.push({ + id: id, + turtle_int: 0, + turtle_foo: "#" + id, + }); + } + ids.push(1, 2, 3); + this.data.partner.records[0].turtles = ids; this.data.partner.onchanges = { turtles: function (obj) { obj.turtles = [[5]].concat(obj.turtles); @@ -2472,6 +2492,7 @@ QUnit.module('relational_fields', { res_id: 1, }); + form.$('.o_pager_next').click(); assert.strictEqual(form.$('td.o_data_cell:not(.o_handle_cell)').text(), "yopblipkawa", "should have the 3 rows in the correct order"); @@ -2486,7 +2507,10 @@ QUnit.module('relational_fields', { {position: 'top'} ); + assert.strictEqual(form.$('.o_data_cell').text(), "blurpkawablip", "should display to record in 'turtle_int' order"); + form.$buttons.find('.o_form_button_save').click(); + form.$('.o_pager_next').click(); assert.strictEqual(form.$('.o_data_cell:not(.o_handle_cell)').text(), "blurpkawablip", "should display to record in 'turtle_int' order"); @@ -2494,6 +2518,126 @@ QUnit.module('relational_fields', { form.destroy(); }); + QUnit.test('onchange followed by edition on the second page', function (assert) { + assert.expect(20); + + var ids = []; + for (var i=1; i<85; i++) { + var id = 10 + i; + ids.push(id); + this.data.turtle.records.push({ + id: id, + turtle_int: id/3|0, + turtle_foo: "#" + i, + }); + } + ids.splice(41, 0, 1, 2, 3); + this.data.partner.records[0].turtles = ids; + this.data.partner.onchanges = { + turtles: function (obj) { + obj.turtles = [[5]].concat(obj.turtles); + }, + }; + + var form = createView({ + View: FormView, + model: 'partner', + data: this.data, + arch:'
' + + '' + + '' + + '' + + '' + + '' + + '' + + '' + + '' + + '' + + '' + + '
', + res_id: 1, + }); + + form.$buttons.find('.o_form_button_edit').click(); + form.$('.o_pager_next').click(); + + form.$('.o_field_one2many .o_list_view tbody tr:eq(1) td:first').click(); + form.$('.o_field_one2many .o_list_view tbody tr:eq(1) input:first').val('value 1').trigger('input'); + form.$('.o_field_one2many .o_list_view tbody tr:eq(2) td:first').click(); + form.$('.o_field_one2many .o_list_view tbody tr:eq(2) input:first').val('value 2').trigger('input'); + + assert.strictEqual(form.$('.o_data_row').length, 40, "should display 40 records"); + assert.strictEqual(form.$('.o_data_row:has(.o_data_cell:contains(#39))').index(), 0, "should display '#39' at the first line"); + + form.$('.o_field_x2many_list_row_add a').click(); + + assert.strictEqual(form.$('.o_data_row').length, 40, "should display 39 records and the create line"); + assert.strictEqual(form.$('.o_data_row:first .o_field_char').length, 1, "should display the create line in first position"); + assert.strictEqual(form.$('.o_data_row:first .o_field_char').val(), "", "should an empty input"); + assert.strictEqual(form.$('.o_data_row:has(.o_data_cell:contains(#39))').index(), 1, "should display '#39' at the second line"); + + form.$('.o_data_row input:first').val('value 3').trigger('input'); + + assert.strictEqual(form.$('.o_data_row:first .o_field_char').length, 1, "should display the create line in first position after onchange"); + assert.strictEqual(form.$('.o_data_row:has(.o_data_cell:contains(#39))').index(), 1, "should display '#39' at the second line after onchange"); + + form.$('.o_field_x2many_list_row_add a').click(); + + assert.strictEqual(form.$('.o_data_row').length, 40, "should display 39 records and the create line"); + assert.strictEqual(form.$('.o_data_row:first .o_field_char').length, 1, "should display the create line in first position"); + assert.strictEqual(form.$('.o_data_row:has(.o_data_cell:contains(value 3))').index(), 1, "should display the created line at the second position"); + assert.strictEqual(form.$('.o_data_row:has(.o_data_cell:contains(#39))').index(), 2, "should display '#39' at the third line"); + + form.destroy(); + + // bottom order + + form = createView({ + View: FormView, + model: 'partner', + data: this.data, + arch:'
' + + '' + + '' + + '' + + '' + + '' + + '' + + '' + + '' + + '' + + '' + + '
', + res_id: 1, + }); + + form.$buttons.find('.o_form_button_edit').click(); + form.$('.o_pager_next').click(); + + form.$('.o_field_one2many .o_list_view tbody tr:eq(1) td:first').click(); + form.$('.o_field_one2many .o_list_view tbody tr:eq(1) input:first').val('value 1').trigger('input'); + form.$('.o_field_one2many .o_list_view tbody tr:eq(2) td:first').click(); + form.$('.o_field_one2many .o_list_view tbody tr:eq(2) input:first').val('value 2').trigger('input'); + + assert.strictEqual(form.$('.o_data_row').length, 40, "should display 40 records"); + assert.strictEqual(form.$('.o_data_row:has(.o_data_cell:contains(#77))').index(), 39, "should display '#77' at the last line"); + + form.$('.o_field_x2many_list_row_add a').click(); + + assert.strictEqual(form.$('.o_data_row').length, 40, "should display 39 records and the create line"); + assert.strictEqual(form.$('.o_data_row:has(.o_data_cell:contains(#76))').index(), 38, "should display '#76' at the penultimate line"); + assert.strictEqual(form.$('.o_data_row:has(.o_field_char)').index(), 39, "should display the create line at the last position"); + + form.$('.o_data_row input:first').val('value 3').trigger('input'); + form.$('.o_field_x2many_list_row_add a').click(); + + assert.strictEqual(form.$('.o_data_row').length, 40, "should display 39 records and the create line"); + assert.strictEqual(form.$('.o_data_row:has(.o_data_cell:contains(#76))').index(), 38, "should display '#76' at the penultimate line"); + assert.strictEqual(form.$('.o_data_row:has(.o_field_char)').index(), 39, "should display the create line at the last position"); + + form.destroy(); + }); + QUnit.test('embedded one2many with handle widget with minimum setValue calls', function (assert) { var done = assert.async(); assert.expect(20); @@ -5656,9 +5800,9 @@ QUnit.module('relational_fields', { // enable the many2many onchange and generate it form.$('input.o_field_integer[name="int_field"]').val('10').trigger('input'); - assert.strictEqual(form.$('.o_data_cell.o_required_modifier').text(), "xphonexenomorphe", + assert.strictEqual(form.$('.o_data_cell.o_required_modifier').text(), "xenomorphexphone", 'should display the product xphone and xenomorphe'); - assert.strictEqual(form.$('.o_data_row').text().replace(/\s+/g, ' '), "new linexphone first record firstxenomorphe second record ", + assert.strictEqual(form.$('.o_data_row').text().replace(/\s+/g, ' '), "firstxenomorphe second record new linexphone first record ", 'should display the name, one2many and many2many value'); // disable the many2many onchange @@ -5688,19 +5832,19 @@ QUnit.module('relational_fields', { // put list in readonly mode form.$('input.o_field_integer[name="int_field"]').click(); - assert.strictEqual(form.$('.o_data_cell.o_required_modifier').text(), "xphonexenomorphe", + assert.strictEqual(form.$('.o_data_cell.o_required_modifier').text(), "xenomorphexphone", 'should display the product xphone and xenomorphe'); - assert.strictEqual(form.$('.o_field_many2manytags:not(.o_input) .o_badge_text').text(), "first recordsecond record", + assert.strictEqual(form.$('.o_field_many2manytags:not(.o_input) .o_badge_text').text(), "second recordfirst record", 'should display the tag in readonly (first record and second record)'); form.$('input.o_field_integer[name="int_field"]').val('10').trigger('input'); - assert.strictEqual(form.$('.o_data_row').text().replace(/\s+/g, ' '), "new linexphone first record firstxenomorphe second record ", + assert.strictEqual(form.$('.o_data_row').text().replace(/\s+/g, ' '), "firstxenomorphe second record new linexphone first record ", 'should display the name, one2many and many2many value'); form.$buttons.find('.o_form_button_save').click(); - assert.strictEqual(form.$('.o_data_row').text().replace(/\s+/g, ' '), "new linexphone first record firstxenomorphe second record ", + assert.strictEqual(form.$('.o_data_row').text().replace(/\s+/g, ' '), "firstxenomorphe second record new linexphone first record ", 'should display the name, one2many and many2many value after save'); form.destroy(); @@ -6838,8 +6982,8 @@ QUnit.module('relational_fields', { mockRPC: function (route, args) { assert.step(args.method); if (args.method === 'write') { - assert.strictEqual(args.args[1].turtles[42][0], 0); - assert.deepEqual(args.args[1].turtles[42][2], {turtle_foo: 'rainbow dash'}); + assert.strictEqual(args.args[1].turtles[40][0], 0, 'should send a create command'); + assert.deepEqual(args.args[1].turtles[40][2], {turtle_foo: 'rainbow dash'}); } return this._super.apply(this, arguments); }, @@ -6892,8 +7036,8 @@ QUnit.module('relational_fields', { mockRPC: function (route, args) { assert.step(args.method); if (args.method === 'write') { - assert.strictEqual(args.args[1].turtles[0][0], 0); - assert.deepEqual(args.args[1].turtles[0][2], {turtle_foo: 'rainbow dash'}); + assert.strictEqual(args.args[1].turtles[40][0], 0); + assert.deepEqual(args.args[1].turtles[40][2], {turtle_foo: 'rainbow dash'}); } return this._super.apply(this, arguments); }, @@ -6909,7 +7053,8 @@ QUnit.module('relational_fields', { form.$('.o_field_x2many_list_row_add a').click(); assert.strictEqual(form.$('tr.o_data_row').length, 3, - "should have 3 data rows on the current page"); + "should have 3 data rows on the current page (2 records and the created line)"); + assert.ok(form.$('tr.o_data_row').first().hasClass('o_selected_row'), "first row should be selected"); -- cgit v1.2.3 From 73e2ba991c0e74654f3c2e2ae02485196d25fe1e Mon Sep 17 00:00:00 2001 From: Christophe Matthieu Date: Wed, 6 Dec 2017 13:51:42 +0100 Subject: [FIX] web: add a stableSort method for sorting x2m Issue: create 60 lines in ordered x2many with the same value (0) for the order field and make a change ; the displayed records will be switched. The problem appears because the sorting function is not stable and the records with the same values can change place (hence change page), which is quite disturbing for the user. --- .../static/tests/fields/relational_fields_tests.js | 113 +++++++++++++++++++++ 1 file changed, 113 insertions(+) (limited to 'addons/web/static/tests/fields/relational_fields_tests.js') diff --git a/addons/web/static/tests/fields/relational_fields_tests.js b/addons/web/static/tests/fields/relational_fields_tests.js index 208f00298d3..853c3bd69d6 100644 --- a/addons/web/static/tests/fields/relational_fields_tests.js +++ b/addons/web/static/tests/fields/relational_fields_tests.js @@ -2518,6 +2518,119 @@ QUnit.module('relational_fields', { form.destroy(); }); + QUnit.test('onchange with modifiers for embedded one2many on the second page', function (assert) { + assert.expect(7); + + var data = this.data; + var ids = []; + for (var i=10; i<60; i++) { + var id = 10 + i; + ids.push(id); + data.turtle.records.push({ + id: id, + turtle_int: 0, + turtle_foo: "#" + id, + }); + } + ids.push(1, 2, 3); + data.partner.records[0].turtles = ids; + data.partner.onchanges = { + turtles: function (obj) { + // TODO: make this test more 'difficult' + // For now, the server only returns UPDATE commands (no LINK TO) + // even though it should do it (for performance reasons) + // var turtles = obj.turtles.splice(0, 20); + + var turtles = []; + turtles.unshift([5]); + // create UPDATE commands for each records (this is the server + // usual answer for onchange) + for (var k in obj.turtles) { + var change = obj.turtles[k]; + var record = _.findWhere(data.turtle.records, {id: change[1]}); + if (change[0] === 1) { + _.extend(record, change[2]); + } + turtles.push([1, record.id, record]); + } + obj.turtles = turtles; + }, + }; + + var form = createView({ + View: FormView, + model: 'partner', + data: data, + arch:'
' + + '' + + '' + + '' + + '' + + '' + + '' + + '' + + '' + + '' + + '' + + '' + + '
', + res_id: 1, + }); + + form.$buttons.find('.o_form_button_edit').click(); + + assert.equal(form.$('.o_field_one2many td[class="o_data_cell"]').text(), "#20#21#22#23#24#25#26#27#28#29", + "should display the records in order"); + + form.$('.o_field_one2many .o_list_view tbody tr:first td:first').click(); + form.$('.o_field_one2many .o_list_view tbody tr:first input:first').val('blurp').trigger('input'); + + // the domain fail if the widget does not use the allready loaded data. + form.$buttons.find('.o_form_button_cancel').click(); + + assert.equal(form.$('.o_field_one2many td[class="o_data_cell"]').text(), "blurp#21#22#23#24#25#26#27#28#29", + "should display the records in order with the changes"); + + $('.modal .modal-footer button:first').click(); + + assert.equal(form.$('.o_field_one2many td[class="o_data_cell"]').text(), "#20#21#22#23#24#25#26#27#28#29", + "should cancel changes and display the records in order"); + + form.$buttons.find('.o_form_button_edit').click(); + + // Drag and drop the third line in second position + testUtils.dragAndDrop( + form.$('.ui-sortable-handle').eq(2), + form.$('.o_field_one2many tbody tr').eq(1), + {position: 'top'} + ); + + assert.equal(form.$('.o_field_one2many td[class="o_data_cell"]').text(), "#20#30#31#32#33#34#35#36#37#38", + "should display the records in order after resequence (display record with turtle_int=0)"); + + // Drag and drop the third line in second position + testUtils.dragAndDrop( + form.$('.ui-sortable-handle').eq(2), + form.$('.o_field_one2many tbody tr').eq(1), + {position: 'top'} + ); + + assert.equal(form.$('.o_field_one2many td[class="o_data_cell"]').text(), "#20#39#40#41#42#43#44#45#46#47", + "should display the records in order after resequence (display record with turtle_int=0)"); + + form.$buttons.find('.o_form_button_cancel').click(); + + assert.equal(form.$('.o_field_one2many td[class="o_data_cell"]').text(), "#20#39#40#41#42#43#44#45#46#47", + "should display the records in order after resequence"); + + $('.modal .modal-footer button:first').click(); + + assert.equal(form.$('.o_field_one2many td[class="o_data_cell"]').text(), "#20#21#22#23#24#25#26#27#28#29", + "should cancel changes and display the records in order"); + + form.destroy(); + }); + QUnit.test('onchange followed by edition on the second page', function (assert) { assert.expect(20); -- cgit v1.2.3 From d4982394bc9cf2b330e7c87bd7b8d1cae74ffb5f Mon Sep 17 00:00:00 2001 From: Christophe Matthieu Date: Thu, 7 Dec 2017 10:57:08 +0100 Subject: [FIX] web: speed resequence up in x2m Resequencing a x2m is very slow because the view is reloaded after each change instead of only once after all the changes. --- .../web/static/tests/fields/relational_fields_tests.js | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) (limited to 'addons/web/static/tests/fields/relational_fields_tests.js') diff --git a/addons/web/static/tests/fields/relational_fields_tests.js b/addons/web/static/tests/fields/relational_fields_tests.js index 853c3bd69d6..3b9dcf7d684 100644 --- a/addons/web/static/tests/fields/relational_fields_tests.js +++ b/addons/web/static/tests/fields/relational_fields_tests.js @@ -5,6 +5,7 @@ var AbstractField = require('web.AbstractField'); var BasicModel = require('web.BasicModel'); var concurrency = require('web.concurrency'); var FormView = require('web.FormView'); +var ListRenderer = require('web.ListRenderer'); var ListView = require('web.ListView'); var relationalFields = require('web.relational_fields'); var StandaloneFieldManagerMixin = require('web.StandaloneFieldManagerMixin'); @@ -2271,7 +2272,15 @@ QUnit.module('relational_fields', { }); QUnit.test('embedded one2many with handle widget', function (assert) { - assert.expect(8); + assert.expect(10); + + var nbConfirmChange = 0; + testUtils.patch(ListRenderer, { + confirmChange: function () { + nbConfirmChange++; + return this._super.apply(this, arguments); + }, + }); this.data.partner.records[0].turtles = [1, 2, 3]; @@ -2304,8 +2313,10 @@ QUnit.module('relational_fields', { "should have the 3 rows in the correct order"); form.$buttons.find('.o_form_button_edit').click(); + assert.strictEqual(form.$('td.o_data_cell:not(.o_handle_cell)').text(), "yopblipkawa", "should still have the 3 rows in the correct order"); + assert.strictEqual(nbConfirmChange, 0, "should not have confirmed any change yet"); // Drag and drop the second line in first position testUtils.dragAndDrop( @@ -2314,6 +2325,7 @@ QUnit.module('relational_fields', { {position: 'top'} ); + assert.strictEqual(nbConfirmChange, 1, "should have confirmed changes only once"); assert.verifySteps(["0", "1"], "sequences values should be incremental starting from the previous minimum one"); @@ -2333,6 +2345,8 @@ QUnit.module('relational_fields', { assert.strictEqual(form.$('td.o_data_cell:not(.o_handle_cell)').text(), "blipyopkawa", "should still have the 3 rows in the new order"); + testUtils.unpatch(ListRenderer); + form.destroy(); }); -- cgit v1.2.3 From a7c2a22310d52caf96d589f12319f8ac7488d821 Mon Sep 17 00:00:00 2001 From: Christophe Simonis Date: Tue, 9 Jan 2018 17:58:06 +0100 Subject: [FIX] web: adapt new test introduced by previous forward-port --- addons/web/static/tests/fields/relational_fields_tests.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'addons/web/static/tests/fields/relational_fields_tests.js') diff --git a/addons/web/static/tests/fields/relational_fields_tests.js b/addons/web/static/tests/fields/relational_fields_tests.js index d26bb616a5a..de114bac9cf 100644 --- a/addons/web/static/tests/fields/relational_fields_tests.js +++ b/addons/web/static/tests/fields/relational_fields_tests.js @@ -5452,8 +5452,9 @@ QUnit.module('relational_fields', { '', mockRPC: function (route, args) { if (args.method === 'create') { + var virtualID = args.args[0].turtles[0][1]; assert.deepEqual(args.args[0].turtles, - [[0, false, {turtle_foo: "cat"}]], + [[0, virtualID, {turtle_foo: "cat"}]], 'should send proper commands'); } return this._super.apply(this, arguments); -- cgit v1.2.3