Siirry sisältöön
Menu
Sinun on rekisteröidyttävä, jotta voit olla vuorovaikutuksessa yhteisön kanssa.
Tämä kysymys on merkitty
2 Vastaukset
17890 Näkymät

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
Hylkää
Paras vastaus

There is a default_order attribute

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

Avatar
Hylkää
Paras vastaus

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
Hylkää
Aiheeseen liittyviä artikkeleita Vastaukset Näkymät Toimenpide
2
toukok. 18
4231
6
syysk. 17
8269
0
kesäk. 15
3861
3
kesäk. 15
8001
1
maalisk. 15
4480