← Back to team overview

openerp-expert-framework team mailing list archive

Re: Sorting function fields

 

On 09/27/2011 09:53 PM, Antony Lesuisse wrote:
> Yes I agree that it is a _usability_ issue. But let's get technical and public 
> bring the discussion on openerp-expert-framework i see two options:
> 
> - enable client side sort when server side doesnt work in WYSIWYS mode (What 
> you see is what you sort :-)

I am opposed to this solution, as it is 100% counter-intuitive for
users. This is how it worked in 5.0 and it is plain wrong.
Moreover, the few users who are aware of it will load the full list
(limit:None) in order to get correct results (Ferdinand confirmed he was
doing that), giving the same performance trouble as if we did it
server-side anyway!
Some might still be tempted to load the full list to export and
filter/sort in Excel, but with the proper hint we might advice them
otherwise (see below)


> - find a solution to sort server side (computing every records? and maybe 
> caching it?)

That's what stored function fields are for: caching! If storing the
function result is impractical, we should rather find a different
implementation of these function fields. For example we're analyzing
several options to pre-compute periodical stock level (and account
balances) and really cache them ; I think this is the right way to solve
this issue - not other half-baked workarounds.
I agree that having columns that you can't sort/filter by is suprising
to users too, but warning them about it should be sufficient until we
can properly support this, e.g.:
  "<FIELD> is constantly changing and cannot be searched/filtered from
here. You may be able to obtain this information from the related
Analysis screen."

Even if business needs are very important, I believe they should not
eclipse all other aspects. When there is no clean technical solution to
provide a feature (even if badly needed), sometimes it's better to
wait/look for a proper one. Rushing a bad workaround will often raise
more questions/problems than simply not having the feature.
The community has complained at length about half-implemented modules
being published as 'official' and 'certified'. This is similar to me,
and I'd like to avoid more such mistakes.


References