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 45078f6 commit 8863457e54f043abf870675005499f2345b2c401
@@ -648,11 +648,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);
@@ -4661,6 +4661,40 @@ QUnit.module('Views', {

QUnit.only('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"/>' +
fieldDebounce: 100,

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

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

// edit a 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 8863457

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