Odoo Help


How can you change the way a ListView is sorted by default?

on 6/27/13, 2:00 PM 2,851 views

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.

Vasiliy Birukov
on 6/28/13, 3:12 AM

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

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!

on 6/29/13, 12:55 PM

About This Community

This platform is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.


Odoo Training Center

Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.

Test it now

Question tools

0 follower(s)


Asked: 6/27/13, 2:00 PM
Seen: 2851 times
Last updated: 3/16/15, 8:10 AM