Přejít na obsah
Menu
You need to be registered to interact with the community.
This question has been flagged
2 Odpovědi
17886 Zobrazení

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
Zrušit
Nejlepší odpověď

There is a default_order attribute

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

Avatar
Zrušit
Nejlepší odpověď

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
Zrušit
Related Posts Odpovědi Zobrazení Aktivita
2
kvě 18
4231
6
zář 17
8267
0
čvn 15
3861
3
čvn 15
7996
1
bře 15
4479