diff options
| author | Aaron Bohy <aab@odoo.com> | 2017-05-15 15:04:01 +0200 |
|---|---|---|
| committer | Aaron Bohy <aab@odoo.com> | 2017-05-16 08:49:26 +0200 |
| commit | ac092e9ccdc71ea6c95ca7c0833337e7a911fcad (patch) | |
| tree | fed11a4354c65445272eebf36b77a03be437c200 /addons/web/static/tests | |
| parent | 55de60db6e2fb7851526c258f1801f7d321974b7 (diff) | |
[FIX] web: List: force grouped lists to be non editable
Editable grouped list views isn't a supported feature. Before this
rev., grouped lists weren't automatically set as non editable, so
it could cause crashes when the user clicked on rows of grouped
lists with editable="top" or "bottom".
This was for example the case in Timesheets > All timesheets ->
go to list view.
Diffstat (limited to 'addons/web/static/tests')
| -rw-r--r-- | addons/web/static/tests/views/list_tests.js | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/addons/web/static/tests/views/list_tests.js b/addons/web/static/tests/views/list_tests.js index 460d046ff52..a74192731ec 100644 --- a/addons/web/static/tests/views/list_tests.js +++ b/addons/web/static/tests/views/list_tests.js @@ -2134,6 +2134,38 @@ QUnit.module('Views', { list.destroy(); }); + + QUnit.test('grouped list are not editable', function (assert) { + // Editable grouped list views are not supported, so the purpose of this + // test is to check that when a list view is grouped, its editable + // attribute is ignored + assert.expect(4); + + var list = createView({ + View: ListView, + model: 'foo', + data: this.data, + arch: '<tree editable="top"><field name="foo"/><field name="bar"/></tree>', + intercepts: { + switch_view: function () { + assert.step('switch view'); + }, + }, + }); + + list.$('.o_data_cell:first').click(); + assert.verifySteps([], 'no switch view should have been requested'); + assert.strictEqual(list.$('.o_selected_row').length, 1, + "a row should be in edition"); + + // reload with groupBy + list.reload({groupBy: ['bar']}); + list.$('.o_group_header:first').click(); + list.$('.o_data_cell:first').click(); + assert.verifySteps(['switch view'], 'one switch view should have been requested'); + + list.destroy(); + }); }); }); |
