Skip to Content
Меню
Вам необхідно зареєструватися, щоб взаємодіяти зі спільнотою.
Це запитання позначене
2 Відповіді
17894 Переглядів

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?

Аватар
Відмінити
Найкраща відповідь

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>

 

Аватар
Відмінити
Related Posts Відповіді Переглядів Дія
2
трав. 18
4231
6
вер. 17
8270
0
черв. 15
3861
3
черв. 15
8004
1
бер. 15
4481