跳至内容
菜单
此问题已终结
2 回复
17904 查看

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>

 

形象
丢弃
相关帖文 回复 查看 活动
2
5月 18
4234
6
9月 17
8281
0
6月 15
3876
3
6月 15
8018
1
3月 15
4484