diff options
| author | Mohammed Shekha <msh@odoo.com> | 2020-05-29 10:59:30 +0000 |
|---|---|---|
| committer | Aaron Bohy <aab@odoo.com> | 2020-06-08 11:29:59 +0000 |
| commit | 030d8ec6f0fd9590d59bfa0576c965f812e2abeb (patch) | |
| tree | e86ae2a619c47b342624289f4c9eeb8f1ae7fe95 /addons/web/static/tests | |
| parent | 9ffd3cda874444493901c3e35a84775ec1b64d97 (diff) | |
[FIX] web: hide list selection box after multi record save
Before this commit, list selection box was not hidden after multi
record edition.
task-2266999
closes odoo/odoo#52590
X-original-commit: ac46e9f82b7cbfc55f395b66b2011399b9f972f1
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Diffstat (limited to 'addons/web/static/tests')
| -rw-r--r-- | addons/web/static/tests/views/list_tests.js | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/addons/web/static/tests/views/list_tests.js b/addons/web/static/tests/views/list_tests.js index a0c7d4d00ce..d69aef904c1 100644 --- a/addons/web/static/tests/views/list_tests.js +++ b/addons/web/static/tests/views/list_tests.js @@ -1638,6 +1638,40 @@ QUnit.module('Views', { list.destroy(); }); + QUnit.test('selection box is removed after multi record edition', async function (assert) { + assert.expect(6); + + const list = await createView({ + View: ListView, + model: 'foo', + data: this.data, + arch: '<tree multi_edit="1"><field name="foo"/><field name="bar"/></tree>', + }); + + assert.containsN(list, '.o_data_row', 4, + "there should be 4 records"); + assert.containsNone(list.$('.o_cp_buttons'), '.o_list_selection_box', + "list selection box should not be displayed"); + + // select all records + await testUtils.dom.click(list.$('thead .o_list_record_selector input')); + assert.containsOnce(list.$('.o_cp_buttons'), '.o_list_selection_box', + "list selection box should be displayed"); + assert.containsN(list, '.o_data_row .o_list_record_selector input:checked', 4, + "all 4 records should be selected"); + + // edit selected records + await testUtils.dom.click(list.$('.o_data_row:eq(0) .o_data_cell:eq(0)')); + await testUtils.fields.editInput(list.$('.o_field_widget[name=foo]'), 'legion'); + await testUtils.dom.click($('.modal-dialog button.btn-primary')); + assert.containsNone(list.$('.o_cp_buttons'), '.o_list_selection_box', + "list selection box should not be displayed"); + assert.containsNone(list, '.o_data_row .o_list_record_selector input:checked', + "no records should be selected"); + + list.destroy(); + }); + QUnit.test('selection is reset on reload', async function (assert) { assert.expect(8); |
