Are Wizards & Transient Models the right way to implement complex interactive search across several tables (objects) and to visualize data aggregated from several objects?
âComplex interactive searchâ means a search panel with several input fields for entering search criteria, where input fields are dynamically filtered according to user access rules and data from other fields.
âAcross several tablesâ means data stored in different objects (osv.Model) -- i.e. not only in different tables, but in different âpythonâ objects (osv.Model).
My current implementation using wizards & transients has the following drawbacks:
no way of filtering / grouping search results. Search results are handled as a one2many field, displayed as a Tree view in the Form view of the parent search wizard ==> hence no way of grouping results inside a form view of a wizard. Frankly, Iâd be happy if there would be a way of making a complex search over multiple objects from a Tree view, as we do it with simple search on a single object.
2 reloads of a page happen when changing input parameters and making another search. First, the page is refreshed with the old results inside, and then after a second or two (w/o showing âLoadingâ¦â) the page is refreshed with the new results appearing. This doesnât happen if I search with the same parameters several times in a row -- then only 1 refresh happens. This double refresh is very user-unfriendly, as it creates an impression that the search failed (the old results are displayed). Probably, this happens because on every search I create a new wizard instance (to keep a search history before itâs cleared with autovacuum) and return its id as a 'res_id'. However, I create a copy of previous wizard by passing an empty list as default search results ids, so I wouldnât expect the old-results to show up. Also, I wouldnât expect the second refresh to happen.
results from all previous searches are preserved on the client side and just made hidden on the page instead of being removed completely from the page ===> makes the page heavy after a lot of searches. E.g.:
< div class="oe_view_manager oe_view_manager_inline" style="display: none;" >
< div class="oe_view_manager oe_view_manager_inline" style="display: none;" >
< div class="oe_view_manager oe_view_manager_inline" style="display: none;" >
< div class="oe_view_manager oe_view_manager_inline" >
Here: 3 old result sets + the current active one (visible). Think I can get rid of those old results using JavaScript. Still, I wonder what is the purpose of such preserve&hide behavior?