diff options
| author | Achraf (abz) <abz@odoo.com> | 2021-01-06 10:14:05 +0000 |
|---|---|---|
| committer | Nasreddin (bon) <bon@odoo.com> | 2021-01-28 15:23:07 +0000 |
| commit | 813b9fc42f5d0cc4e35afb642291200b90d1f545 (patch) | |
| tree | a5ed0c0a74a97381b0cbcfb29e6d9e2de81ae3da /addons/web/static/tests/views | |
| parent | 60b58322dc803dfbf734374b63f9556563a19b8f (diff) | |
[FIX] web: Show create button on multiEdit + unit test
What are the steps to reproduce your issue ?
1. Install project
2. Open any project
3. Switch to list view and display by Stage
4. Open categoryA and select some records
5. Open CategoryB
What is currently happening ?
The button create is not displayed
What are you expecting to happen ?
Don't hide create button
opw-2423701
closes odoo/odoo#64136
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Diffstat (limited to 'addons/web/static/tests/views')
| -rw-r--r-- | addons/web/static/tests/views/list_tests.js | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/addons/web/static/tests/views/list_tests.js b/addons/web/static/tests/views/list_tests.js index 6e142dff2ff..48eadf34a77 100644 --- a/addons/web/static/tests/views/list_tests.js +++ b/addons/web/static/tests/views/list_tests.js @@ -9059,6 +9059,44 @@ QUnit.module('Views', { list.destroy(); }); + QUnit.test('control panel buttons in multi editable grouped list views', async function (assert) { + assert.expect(8); + + const list = await createView({ + View: ListView, + model: 'foo', + data: this.data, + groupBy: ['foo'], + arch: + `<tree multi_edit="1"> + <field name="foo"/> + <field name="int_field"/> + </tree>`, + }); + + assert.containsNone(list, '.o_data_row', "all groups should be closed"); + assert.isVisible(list.$buttons.find('.o_list_button_add'), + "should have a visible Create button"); + + await testUtils.dom.click(list.$('.o_group_header:first')); + assert.containsN(list, '.o_data_row', 1, "first group should be opened"); + assert.isVisible(list.$buttons.find('.o_list_button_add'), + "should have a visible Create button"); + + await testUtils.dom.click(list.$('.o_data_row:eq(0) .o_list_record_selector input')); + assert.containsOnce(list, '.o_data_row:eq(0) .o_list_record_selector input:enabled', + "should have selected first record"); + assert.isVisible(list.$buttons.find('.o_list_button_add'), + "should have a visible Create button"); + + await testUtils.dom.click(list.$('.o_group_header:last')); + assert.containsN(list, '.o_data_row', 2, "two groups should be opened"); + assert.isVisible(list.$buttons.find('.o_list_button_add'), + "should have a visible Create button"); + + list.destroy(); + }); + QUnit.test('edit a line and discard it in grouped editable', async function (assert) { assert.expect(5); |
