[IMP] web: No quick filter available message replacement
Description of the issue/feature this commit addresses: When opening a view with the quick filters available with a domain which returns no data, a message shows up saying that no filter is available for the data that has been retreived and tells the user that updating the filters will allow him to display more records and maybe make the quick filter available. This message is displayed in a way which is not so great for user experience as it is written in a very thin column making the text being written one word per line. The example used to point out that problem is using the mexican localization, going in the accounting app, in the tax report and clicking on any value equals to zero. Desired behavior after the commit is merged : This commit replaces that message with a "All" button like it would be if the domain had returned data and some filters were available. Only this time, no filter is available under the button as there is still no data to filter. Adding this fix, there is no messy message showing up in the quick filters column when the query was not able to rertrieve any data with the given domain. task-3462024 closes odoo/odoo#138060 X-original-commit: 262b71aad23296f059938496a740ba61e71daea8 Related: odoo/enterprise#48636 Signed-off-by: Olivier Colson (oco) <oco@odoo.com> Signed-off-by: Thomas Becquevort (thbe) <thbe@odoo.com>
This commit is contained in:
@@ -16,9 +16,9 @@
|
||||
t-attf-class="#{env.isSmall ? 'px-3' : 'pe-1 ps-3'}"
|
||||
t-ref="root">
|
||||
<div t-if="!sections or sections.length === 0" class="o_search_panel_empty_state me-3">
|
||||
<p class="mt-3 small text-muted">No quick filter available.</p>
|
||||
<p class="small text-muted">Update the filters in the search bar to display more records.</p>
|
||||
<p class="small text-muted">Quick filters will become available if the records shown can be filtered.</p>
|
||||
<button class="btn w-100 overflow-visible">
|
||||
<div class="d-flex align-items-center me-2 ms-auto">All</div>
|
||||
</button>
|
||||
</div>
|
||||
<section t-foreach="sections" t-as="section" t-key="section.id"
|
||||
t-attf-class="o_search_panel_section o_search_panel_{{ section.type }}"
|
||||
|
||||
@@ -3453,9 +3453,9 @@ QUnit.module("Search", (hooks) => {
|
||||
);
|
||||
assert.containsN(
|
||||
target,
|
||||
".o_search_panel_empty_state p",
|
||||
3,
|
||||
"Empty state container has 3 paragraphs"
|
||||
".o_search_panel_empty_state button",
|
||||
1,
|
||||
"Empty state has the All button"
|
||||
);
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user