Odoo Help

Cyril Gaspard (GEM)
On 10/13/18, 2:39 PM


another way to test, perhaps try to redefine _order attribute of your class:

class Myclass(models.Model):

    _inherit = 'my.class'

    _order = 'id desc, name desc'

else you can tried to use attribute  default_order in tree or kanban view


On 1/20/15, 7:15 AM

@Pascal, I tried adding the id field as you have done (using OpenERP v7) and I can sort based on the ID field.  Note that you can only sort by 1 column at any time.  Note that you cannot sort by Complete ID and Display Name as they are function fields.  You did not redefined the ID field, did you?

I didn't redefined the ID field. Should I? How?

Pascal Tremblay
on 1/20/15, 7:27 AM

I'm in Odoo v8

Pascal Tremblay
on 1/20/15, 7:28 AM

No, you shouldn't need to redefine the field. Haven't tried it in v8.

on 1/20/15, 8:07 AM

@Pascal I've tried on v8. It seems that all ID columns are deemed unsortable in v8. If you add other fields like create_uid, you can still sort by that column. Sorry, can't help you further on this.

on 1/20/15, 11:54 PM

Thanks Ivan

Pascal Tremblay
on 1/23/15, 6:49 AM

About This Community

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

Question tools

4 follower(s)


Asked: 1/20/15, 6:26 AM
Seen: 7187 times
Last updated: 10/13/18, 2:39 PM