Odoo Help

5
0
Avatar

Cyril Gaspard (GEM)

--Cyril Gaspard (GEM)--

4274
| 5 6 8
Paris, France
--Cyril Gaspard (GEM)--

Forum contributor since 2008

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

Hi,

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

Regards

0
Avatar

Ivan

--Ivan--

3390
| 5 3 7
Jakarta, Indonesia
--Ivan--
Ivan
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.

Ivan
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.

Ivan
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

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

4 follower(s)

Stats

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