diff --git a/addons/purchase/__manifest__.py b/addons/purchase/__manifest__.py index 5d144d44f1e..1d8311943bd 100644 --- a/addons/purchase/__manifest__.py +++ b/addons/purchase/__manifest__.py @@ -40,7 +40,6 @@ 'web.assets_backend': [ 'purchase/static/src/toaster_button/*', 'purchase/static/src/views/*.js', - 'purchase/static/src/views/*.scss', 'purchase/static/src/js/tours/purchase.js', 'purchase/static/src/**/*.xml', ], diff --git a/addons/purchase/static/src/views/purchase_listview.scss b/addons/purchase/static/src/views/purchase_listview.scss deleted file mode 100644 index cc3c00556ad..00000000000 --- a/addons/purchase/static/src/views/purchase_listview.scss +++ /dev/null @@ -1,3 +0,0 @@ -.o_rfq_no_content { - position: relative; -} \ No newline at end of file diff --git a/addons/purchase/static/src/views/purchase_listview.xml b/addons/purchase/static/src/views/purchase_listview.xml index 383d2a13489..d9ba48f0e75 100644 --- a/addons/purchase/static/src/views/purchase_listview.xml +++ b/addons/purchase/static/src/views/purchase_listview.xml @@ -1,21 +1,7 @@ - - - - - - - + - - - - - - - - diff --git a/addons/web/static/src/legacy/scss/modal.scss b/addons/web/static/src/legacy/scss/modal.scss index d2a411ab3d0..1d21ec56cc7 100644 --- a/addons/web/static/src/legacy/scss/modal.scss +++ b/addons/web/static/src/legacy/scss/modal.scss @@ -36,10 +36,6 @@ } } - > :not(.o_legacy_view_sample_data) .o_view_nocontent { - position: unset; - } - .o_modal_changes td { &:first-child { padding-right: 10px; diff --git a/addons/web/static/src/views/list/list_renderer.js b/addons/web/static/src/views/list/list_renderer.js index 2bf7e1477c0..2829c5906a7 100644 --- a/addons/web/static/src/views/list/list_renderer.js +++ b/addons/web/static/src/views/list/list_renderer.js @@ -140,7 +140,7 @@ export class ListRenderer extends Component { if (this.env.searchModel) { useBus(this.env.searchModel, "focus-view", () => { - if (this.props.list.model.useSampleModel || !this.showTable) { + if (this.props.list.model.useSampleModel) { return; } @@ -180,7 +180,7 @@ export class ListRenderer extends Component { () => { this.freezeColumnWidths(); }, - () => [this.state.columns, this.isEmpty, this.showTable] + () => [this.state.columns, this.isEmpty] ); useExternalListener(window, "resize", () => { this.columnWidths = null; @@ -224,9 +224,6 @@ export class ListRenderer extends Component { // The following code manipulates the DOM directly to avoid having to wait for a // render + patch which would occur on the next frame and cause flickering. freezeColumnWidths() { - if (!this.showTable) { - return; - } if (!this.keepColumnWidths) { this.columnWidths = null; } @@ -1586,11 +1583,6 @@ export class ListRenderer extends Component { return !group.isFolded && group.list.limit < group.list.count; } - get showTable() { - const { model } = this.props.list; - return model.hasData() || !this.props.noContentHelp; - } - toggleGroup(group) { group.toggle(); } diff --git a/addons/web/static/src/views/list/list_renderer.xml b/addons/web/static/src/views/list/list_renderer.xml index ced2c91d4b3..5dfca43a226 100644 --- a/addons/web/static/src/views/list/list_renderer.xml +++ b/addons/web/static/src/views/list/list_renderer.xml @@ -3,8 +3,7 @@
- +
diff --git a/addons/web/static/tests/views/list_view_tests.js b/addons/web/static/tests/views/list_view_tests.js index 809eabf59ed..d09de3b8697 100644 --- a/addons/web/static/tests/views/list_view_tests.js +++ b/addons/web/static/tests/views/list_view_tests.js @@ -4257,32 +4257,26 @@ QUnit.module("Views", (hooks) => { noContentHelp: '

click to add a foo

', }); - // as help is being provided in the action, table won't be rendered until a record exists - assert.containsNone( - target, - ".o_list_table", - " there should not be any records in the view." - ); assert.containsOnce(target, ".o_view_nocontent", "should have no content help"); // click on create button await click(target.querySelector(".o_list_button_add")); - const handleWidgetMinWidth = "33px"; + const handleWidgetWidth = "33px"; const handleWidgetHeader = target.querySelector("thead > tr > th.o_handle_cell"); assert.strictEqual( - window.getComputedStyle(handleWidgetHeader).minWidth, - handleWidgetMinWidth, - "While creating first record, min-width should be applied to handle widget." + window.getComputedStyle(handleWidgetHeader).width, + handleWidgetWidth, + "While creating first record, width should be applied to handle widget." ); // creating one record await editInput(target, ".o_selected_row [name='foo'] input", "test_foo"); await clickSave(target); assert.strictEqual( - window.getComputedStyle(handleWidgetHeader).minWidth, - handleWidgetMinWidth, - "After creation of the first record, min-width of the handle widget should remain as it is" + window.getComputedStyle(handleWidgetHeader).width, + handleWidgetWidth, + "After creation of the first record, width of the handle widget should remain as it is" ); } ); @@ -6581,7 +6575,7 @@ QUnit.module("Views", (hooks) => { noContentHelp: "click to add a partner", }); assert.containsOnce(target, ".o_view_nocontent", "should display the no content helper"); - assert.containsNone(target, ".o_list_view table", "should not have a table in the dom"); + assert.containsOnce(target, ".o_list_view table", "should have a table in the dom"); assert.deepEqual( [...target.querySelectorAll(".o_view_nocontent")].map((el) => el.textContent), ["click to add a partner"] @@ -6595,7 +6589,6 @@ QUnit.module("Views", (hooks) => { ".o_view_nocontent", "should not display the no content helper" ); - assert.containsOnce(target, ".o_list_view table", "should have a table in the dom"); }); QUnit.test("no nocontent helper when no data and no help", async function (assert) { @@ -6678,7 +6671,7 @@ QUnit.module("Views", (hooks) => { target.querySelector(".o_list_view .o_content"), "o_view_sample_data" ); - assert.containsNone(target, ".o_list_table"); + assert.containsOnce(target, ".o_list_table"); assert.containsOnce(target, ".o_nocontent_help"); await toggleMenuItem(target, "False Domain"); @@ -6923,7 +6916,7 @@ QUnit.module("Views", (hooks) => { target.querySelector(".o_list_view .o_content"), "o_view_sample_data" ); - assert.containsNone(target, ".o_list_table"); + assert.containsOnce(target, ".o_list_table"); assert.containsOnce(target, ".o_nocontent_help"); } ); @@ -6967,7 +6960,7 @@ QUnit.module("Views", (hooks) => { target.querySelector(".o_list_view .o_content"), "o_view_sample_data" ); - assert.containsNone(target, ".o_list_table"); + assert.containsOnce(target, ".o_list_table"); assert.containsOnce(target, ".o_nocontent_help"); } ); @@ -7025,7 +7018,7 @@ QUnit.module("Views", (hooks) => { target.querySelector(".o_list_view .o_content"), "o_view_sample_data" ); - assert.containsNone(target, ".o_list_table"); + assert.containsOnce(target, ".o_list_table"); assert.containsOnce(target, ".o_nocontent_help"); } ); @@ -7340,12 +7333,12 @@ QUnit.module("Views", (hooks) => { ".o_view_nocontent", "should have a no content helper displayed" ); - assert.containsNone( + assert.containsOnce( target, "div.table-responsive", - "should not have a div.table-responsive" + "should have a div.table-responsive" ); - assert.containsNone(target, "table", "should not have rendered a table"); + assert.containsOnce(target, "table", "should have rendered a table"); await click(target.querySelector(".o_list_button_add")); assert.containsNone( @@ -7353,7 +7346,6 @@ QUnit.module("Views", (hooks) => { ".o_view_nocontent", "should not have a no content helper displayed" ); - assert.containsOnce(target, "table", "should have rendered a table"); assert.hasClass( target.querySelector("tbody tr"), "o_selected_row", diff --git a/addons/web/static/tests/webclient/actions/window_action_tests.js b/addons/web/static/tests/webclient/actions/window_action_tests.js index 2a6d0fe9118..69e2322104a 100644 --- a/addons/web/static/tests/webclient/actions/window_action_tests.js +++ b/addons/web/static/tests/webclient/actions/window_action_tests.js @@ -2501,12 +2501,11 @@ QUnit.module("ActionManager", (hooks) => { assert.containsOnce(target, ".o_list_view"); assert.containsOnce(target, ".o_view_nocontent"); assert.strictEqual(target.querySelector(".o_view_nocontent").innerText, "Hello"); - assert.containsNone(target, "table"); + assert.containsOnce(target, "table"); await doAction(webClient, 4); assert.containsOnce(target, ".o_list_view"); assert.containsNone(target, ".o_view_nocontent"); - assert.containsOnce(target, "table"); }); QUnit.test("process context.form_view_initial_mode", async function (assert) {