تخطي للذهاب إلى المحتوى
القائمة
لقد تم الإبلاغ عن هذا السؤال
2 الردود
17935 أدوات العرض

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
مايو 18
4271
6
سبتمبر 17
8325
0
يونيو 15
3890
3
يونيو 15
8052
1
مارس 15
4506