Zum Inhalt springen
Menü
Sie müssen registriert sein, um mit der Community zu interagieren.
Diese Frage wurde gekennzeichnet
2 Antworten
17879 Ansichten

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
Verwerfen
Beste Antwort

There is a default_order attribute

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

Avatar
Verwerfen
Beste Antwort

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
Verwerfen
Verknüpfte Beiträge Antworten Ansichten Aktivität
2
Mai 18
4230
6
Sept. 17
8266
0
Juni 15
3859
3
Juni 15
7991
1
März 15
4477