Default active columns, default sorting, default columns order, etc

As I understand on How to set default descending sorting order in a tree view?, the choice is to let integrators to “custom” views with declarations like this (@banknote thanks for sharing):

class SaleAnalytics(ModelSQL, ModelView):
    # description (mandatory on first declaration)
    'Sale Analytics'

    # Internal class name. Always used as a reference inside Tryton
    # default: '<module_name>.<class_name>' on Tryton
    # becomes '<module_name>_<class_name>' in the database
    __name__ = ''

    _order_name = 'report_date'
    _order = [('report_date', 'DESC')]

For example, I understand that if, as a user, if I used to present my records by:

  • selecting the columns I want to view
  • sorting by ordering with another one

Then, when I exit and reconnect, I need to repeat this actions before concentrate on my jobs around records analysis. Right?

Like we have bookmarks (which let the user autonome), is it pertinent to think about to keep “view preferences” of users, model by model?

And what about give users the power to order columns to? (Personally, I hate having to handle my mouse, each time I reload a view, for see most interesting columns on the right… it’s boring… :slight_smile: ).

So, is it interesting to think about this possibility arround tree views?

1 Like

Accuracy: I understand that we say to our customers and users: “No, there is no need for this field” (because we will not maintain it, you will not want to pay it financially, and that it will give unnecessary adherence to all of Tryton’s developments, for example).

On the other hand, when a field (presentable on a column) is the user’s layout (at sight), I think it would be cool to give him the possiblity to:

  • select the columns that he prefers to see displayed (among those available – which is already the case in Tryton and it’s good),
  • arbitrarily modify the order of displaying columns (when, of course, it makes sense and it is technically inexpensive),
  • keep users display “preferences” from any view in memory.

Yes but normally the default order should be chosen as the most expected.
For the optional column, it is kept by user.

It should not be necessary if the view is correctly designed, the default order should be good enough.


My question was more about keeping selected colomns and sort order, to be reloaded automaticaly (cookies?) without having to reselect them when the user close his session?

OK. I will be able to explain this without problem to our users/customers (travailler moins et gagner plus! :slight_smile: