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?
Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:
- CRM
- e-Commerce
- Contabilitate
- Inventar
- PoS
- Project
- MRP
Această întrebare a fost marcată
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>
Enjoying the discussion? Don't just read, join in!
Create an account today to enjoy exclusive features and engage with our awesome community!
Înscrie-teRelated Posts | Răspunsuri | Vizualizări | Activitate | |
---|---|---|---|---|
|
2
mai 18
|
4230 | ||
|
6
sept. 17
|
8266 | ||
|
0
iun. 15
|
3861 | ||
|
3
iun. 15
|
7994 | ||
|
1
mar. 15
|
4479 |