Odoo Help

5
12 Answers
0
Avatar

Cyril Gaspard (GEM)

--Cyril Gaspard (GEM)--

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

Forum contributor since 2008

Cyril Gaspard (GEM)
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--

3400
| 5 3 7
Jakarta, Indonesia
--Ivan--
Ivan
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?

5 Comments
Pascal Tremblay
1/20/15, 7:27 AM

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

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

I'm in Odoo v8

Ivan
1/20/15, 8:07 AM

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

Ivan
1/20/15, 11:54 PM

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

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

Thanks Ivan

Ask a Question
Writer
Keep Informed
4 follower(s)
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.

Register
Odoo Training Center

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

Test it now