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

I heard adding "_order = 'default_order_field_wanted desc'" to the object in the TreeView supposebly works. But for me it doesn't, I just get a ValidateError.

What is the correct way to sort a list by default? (For instance on partner name)

الصورة الرمزية
إهمال

It must work! Check your code. Field must be define in tree form (XML). Also try restart server.

أفضل إجابة

Hi this must be work

add it with _name and columns like :

         _name = 'name.of.the.object'
         _order = 'date_order desc'

and you can also clicking on columns of tree view get sorted records Thanks
Sandeep

الصورة الرمزية
إهمال

Take care on, modification file, if u can order partners, u need to modifie the /addons/base/res/res_partner.py, and not the /addons/crm/res_partner.ps .. just for example!