Odoo Help

Welcome!

This community is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.

2

Complex interactive search across several objects/tables - how?

By
Anton Chepurov
on 12/3/13, 7:01 PM 1,580 views

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?

Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

About This Community

This community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

0 follower(s)

Stats

Asked: 12/3/13, 7:01 PM
Seen: 1580 times
Last updated: 3/16/15, 8:10 AM