Skip to Content
Menu
This question has been flagged
2 Replies
17900 Rodiniai

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?

Portretas
Atmesti
Best Answer

There is a default_order attribute

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

Portretas
Atmesti
Best Answer

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>

 

Portretas
Atmesti
Related Posts Replies Rodiniai Veikla
2
geg. 18
4233
6
rugs. 17
8274
0
birž. 15
3873
3
birž. 15
8016
1
kov. 15
4484