Se rendre au contenu
Menu
Cette question a été signalée
2 Réponses
18167 Vues

I was wondering if there is a way to set the order_by for a specific tree view in the xml code.  Is there a way to do this?

Avatar
Ignorer
Meilleure réponse

There is a default_order attribute

https://www.odoo.com/documentation/8.0/reference/views.html#lists

Avatar
Ignorer
Meilleure réponse

You can do this in your module's action code (or inherit an already existing action). 

Set it in the context with 'order'.  To order it by the Status field for instance (which is 'state' in the database):

 <record id="action_unique_identifier" model="ir.actions.act_window">
             <!-- a bunch of fields -->
            <field name="context">{'order': 'state'}</field>

 

Avatar
Ignorer
Publications associées Réponses Vues Activité
2
mai 18
4467
6
sept. 17
8687
0
juin 15
4083
3
juin 15
8251
1
mars 15
4704