WIP: ODS-style exports do not work with “Hide Listbox Rows (if no Search Criterion)”
Description of the problem
On Nexedi ERP5, we recently ran into an issue: when trying to export Support Requests (using the « Export as Spreadsheet » action), the exported document was empty when using the RenderJS interface. On XHTML style interface, however, the document would not be empty if at least one search criterion was selected. I’ll therefore further describe the problem as two separate issues:
- even with a search criterion given on the RenderJS interface, nothing shows up;
- without a search criterion, nothing shows up at all.
Please let me remind first that we use on Nexedi ERP5 the “Hide Listbox Rows (if no Search Criterion)” system preference, which does exactly what it says: it does not show anything in listboxes when no search criterion is given.
Nothing shows on RenderJS
Contrary to the XHTML interface, RenderJS only uses full-text search. However, the method isHideRowsOnNoSearchCriterion
which tries to determine if rows should be shown, does not seem to account for it, instead iterating over the separate search fields. The second commit of this MR suggests a fix to solve it, by simply showing rows when a full-text search is made.
Nothing shows up without a search criterion
Even with the aforementioned commit, nothing would show up in exports, regardless of the interface used (RenderJS or XHTML). This behaviour is linked to the same option: the export is simply a custom ODS skin showing the content of the listboxes, which do not contain any content without a search criterion. Fortunately, an option exists to force displaying all rows: ignore_hide_rows
, and my first commit adds it to the ODS macro to restore functioning exports (this is what has been done on production for now).
I am still unsure if any of these two fixes is the right way to go, or if there is another way, that is why I am opening this MR for comments!