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?
Dette spørgsmål er blevet anmeldt
There is a default_order attribute
https://www.odoo.com/documentation/8.0/reference/views.html#lists
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>
Kan du lide at diskutere? Læs ikke bare med, deltag aktivt i debatten!
Opret en konto i dag for at få glæde af eksklusive funktioner, og bliv en del af vores skønne fællesskab!
Tilmeld dig| Relaterede indlæg | Besvarelser | Visninger | Aktivitet | |
|---|---|---|---|---|
|
|
2
maj 18
|
5996 | ||
|
|
6
sep. 17
|
10958 | ||
|
|
0
jun. 15
|
5351 | ||
|
|
3
jun. 15
|
9810 | ||
|
|
1
mar. 15
|
6233 |