Skip to Content
Menu
Musisz się zarejestrować, aby móc wchodzić w interakcje z tą społecznością.
To pytanie dostało ostrzeżenie
2 Odpowiedzi
18422 Widoki

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?

Awatar
Odrzuć
Najlepsza odpowiedź

There is a default_order attribute

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

Awatar
Odrzuć
Najlepsza odpowiedź

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>

 

Awatar
Odrzuć
Powiązane posty Odpowiedzi Widoki Czynność
2
maj 18
4767
6
wrz 17
9101
0
cze 15
4314
3
cze 15
8559
1
mar 15
4957