Hello,
I have an hard question.
Is it possible to define a search view that should trigger after all the other filters?
I explain.
I have defined a search function on a computed field but this search function have to trigger a filtered because it is a simple count that can't be stored on database.
If i do this search function:
def _search(args)
elems = self.env[modelname].search([]) # or specific search
elems = elems.filtered(lambda l: l.field_name and logic)
return [('id','in',elems.ids)]
If there are other filters on the same model , they are not considered.
imagine that on modelname there is a date filter applied on the view.
In the previous search function is not considered and is done a full search of ALL items that is poor in performance.
Is there some hidden trick or function to define a search function that can obtain the previous filtered items on which apply filtered and other filter logic?
In the previous example , it's very nice if in _search function i obtain the already data filtered by date on which i can do the filtered. It will be very fast