Skip to content
Browse files

[FIX] web: list: multi edit: do not create new row

...when validating last row by pressing ENTER.

In single edition, we automatically add a new row when the user
edits the last one and presses ENTER. This is something we don't
want in multi edition.

Task 2068280
  • Loading branch information...
aab-odoo committed Sep 11, 2019
1 parent 6fe9dc9 commit 23742009bef09388ff4c6c0ca2e848ce099bd3d4
@@ -649,11 +649,8 @@ var ListController = BasicController.extend({
this.fieldChangedPrevented = ev;
} else if (this._inMultipleRecordEdition( {
// deal with edition of multiple lines
var _onSuccess =; = function () {
Promise.resolve(_onSuccess()).then(function () {
return self._saveMultipleRecords(,,;
this._super.apply(this, arguments);
@@ -4685,6 +4685,41 @@ QUnit.module('Views', {

QUnit.test('editable list view: multi edition: edit and validate last row', async function (assert) {

var list = await createView({
View: ListView,
model: 'foo',
arch: '<tree editable="bottom">' +
'<field name="foo"/>' +
'<field name="int_field"/>' +
// in this test, we want to accurately mock what really happens, that is, input
// fields only trigger their changes on 'change' event, not on 'input'
fieldDebounce: 100000,

assert.containsN(list, '.o_data_row', 4);

// select all records
await$('.o_list_view thead .o_list_record_selector input'));

// edit last cell of last line
await$('.o_data_row:last .o_data_cell:last'));
testUtils.fields.editInput(list.$('.o_field_widget[name=int_field]'), '666');
await testUtils.fields.triggerKeydown(list.$('tr.o_selected_row .o_data_cell:last input'), 'enter');

assert.containsOnce(document.body, '.modal');
await$('.modal .btn-primary'));

assert.containsN(list, '.o_data_row', 4,
"should not create a new row as we were in multi edition");


QUnit.test('list grouped by date:month', async function (assert) {

0 comments on commit 2374200

Please sign in to comment.
You can’t perform that action at this time.