summaryrefslogtreecommitdiff
path: root/addons/web/static/tests/fields/relational_fields_tests.js
diff options
context:
space:
mode:
authorChristophe Simonis <chs@odoo.com>2017-09-28 13:24:14 +0200
committerChristophe Simonis <chs@odoo.com>2017-09-28 13:24:14 +0200
commit99bf9e4563d8c17be1635fc09d336b693b5ba1a1 (patch)
treeeb04654ef5ef384319aa4292bac122b18445689f /addons/web/static/tests/fields/relational_fields_tests.js
parent6b410fc954ccd85e7aea2c9fa86c6f2097474883 (diff)
parent89df681b458df5b2fd21b738409a90dd53e33c9a (diff)
[MERGE] forward port branch saas-16 up to 89df681b458
Diffstat (limited to 'addons/web/static/tests/fields/relational_fields_tests.js')
-rw-r--r--addons/web/static/tests/fields/relational_fields_tests.js49
1 files changed, 48 insertions, 1 deletions
diff --git a/addons/web/static/tests/fields/relational_fields_tests.js b/addons/web/static/tests/fields/relational_fields_tests.js
index 9b1dd8d8f61..34442ad0d50 100644
--- a/addons/web/static/tests/fields/relational_fields_tests.js
+++ b/addons/web/static/tests/fields/relational_fields_tests.js
@@ -3206,6 +3206,54 @@ QUnit.module('relational_fields', {
form.destroy();
});
+ QUnit.test('pressing escape in editable o2m list in dialog', function (assert) {
+ assert.expect(3);
+
+ var form = createView({
+ View: FormView,
+ model: 'partner',
+ data: this.data,
+ arch: '<form string="Partners">' +
+ '<group>' +
+ '<field name="p">' +
+ '<tree>' +
+ '<field name="display_name"/>' +
+ '</tree>' +
+ '</field>' +
+ '</group>' +
+ '</form>',
+ res_id: 1,
+ archs: {
+ "partner,false,form": '<form>' +
+ '<field name="p">' +
+ '<tree editable="bottom">' +
+ '<field name="display_name"/>' +
+ '</tree>' +
+ '</field>' +
+ '</form>',
+ },
+ viewOptions: {
+ mode: 'edit',
+ },
+ });
+
+ form.$('.o_field_x2many_list_row_add a').click();
+ $('.modal .o_field_x2many_list_row_add a').click();
+
+ assert.strictEqual($('.modal .o_data_row.o_selected_row').length, 1,
+ "there should be a row in edition in the dialog");
+
+ // trigger keydown ESCAPE in the edited row
+ $('.modal .o_data_cell input').trigger({type: 'keydown', which: $.ui.keyCode.ESCAPE});
+
+ assert.strictEqual($('.modal').length, 1,
+ "dialog should still be open");
+ assert.strictEqual($('.modal .o_data_row').length, 0,
+ "the row should have been removed");
+
+ form.destroy();
+ });
+
QUnit.test('editable o2m with onchange and required field: delete an invalid line', function (assert) {
assert.expect(5);
@@ -5954,7 +6002,6 @@ QUnit.module('relational_fields', {
form.destroy();
});
-
QUnit.test('editing tabbed one2many (editable=bottom)', function (assert) {
assert.expect(12);