[FIX] web: esc cancels kanban column quick create
The feature was already declared in AbstractQuickCreate, but the ColumnQuickCreate object did not define a _cancel function.
This commit is contained in:
@@ -266,6 +266,19 @@ var ColumnQuickCreate = AbstractQuickCreate.extend({
|
||||
// Private
|
||||
//--------------------------------------------------------------------------
|
||||
|
||||
/**
|
||||
* Triggers up an event to cancel the quick creation
|
||||
*
|
||||
* @override
|
||||
* @private
|
||||
*/
|
||||
_cancel: function () {
|
||||
if (!this.folded) {
|
||||
this.folded = true;
|
||||
this.$input.val('');
|
||||
this._update();
|
||||
}
|
||||
},
|
||||
/**
|
||||
* Triggers up an event to quick create a column with the given value
|
||||
*
|
||||
|
||||
@@ -1203,7 +1203,7 @@ QUnit.module('Views', {
|
||||
});
|
||||
|
||||
QUnit.test('quick create record & column in grouped on m2o', function (assert) {
|
||||
assert.expect(2);
|
||||
assert.expect(4);
|
||||
|
||||
var kanban = createView({
|
||||
View: KanbanView,
|
||||
@@ -1230,6 +1230,13 @@ QUnit.module('Views', {
|
||||
|
||||
assert.strictEqual(kanban.$('.o_kanban_group:last span:contains(new column)').length, 1,
|
||||
"the last column should be the newly created one");
|
||||
|
||||
assert.strictEqual(kanban.$('.o_kanban_quick_create:visible button.o_kanban_add').length, 1,
|
||||
"the quick create column should still be opened for mass creation");
|
||||
kanban.$('.o_column_quick_create input').trigger($.Event('keydown', { keyCode: $.ui.keyCode.ESCAPE }));
|
||||
assert.strictEqual(kanban.$('.o_kanban_quick_create:visible button.o_kanban_add').length, 0,
|
||||
"the quick create column should now be closed");
|
||||
|
||||
kanban.destroy();
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user