Odoo Help


This community 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.


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

on 6/27/13, 2:00 PM 2,000 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


| 6 5 8
Delhi, India
Python OpenERP Developer http://in.linkedin.com/pub/sandeep-rana/3b/a16/786/
On 6/28/13, 3:43 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

Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

About This Community

This community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

0 follower(s)


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