Odoo Help


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

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

ClueLogics Technologies Pvt. Ltd.

--ClueLogics Technologies Pvt. Ltd.--
| 6 5 8
Delhi NCR, India
--ClueLogics Technologies Pvt. Ltd.--

 ClueLogics Technologies Pvt Ltd is a Software product and services provider. We are positioned to deliver robust, rapid and reliable Information Technology solutions that work. What we succeed upon is Technology and Technical Expertise. The industry review of ClueLogics has been commendable for the past years as most of its business comes from repeat orders by highly satisfied clients.

ClueLogics Technologies Pvt. Ltd.
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

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: 3258 times
Last updated: 3/16/15, 8:10 AM