Skip to Content
Menú
This question has been flagged
1 Respondre
11512 Vistes

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)

Avatar
Descartar

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

Best Answer

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

Avatar
Descartar

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!