Odoo Help


How to sort a list on a one2many fields?

Anirudh Lou
on 8/3/15, 1:34 AM 2,105 views

How can i sort list on a one2many field? This is the situation:

1.In class account_move some of it's field is:

_columns = {
'line_id' : fields.one2many('account_move_line','move_id','Account Move Line'),

2.In class  account_move_line

_columns = {
move_id : fields.many2one('account_move','Account Move'),
account_id : fields.many2one('account_account','Account'),

My problem now is that from the view of account_move when i print its report the account_id is not sorted. So, does anyone who knows how to sort this account_id? By the way i am using Jasper Report.

Thanks for any help/suggestion.


Drees Far

--Drees Far--

| 5 2 7
Tunis, Tunisia
--Drees Far--
Drees Far
On 8/3/15, 5:21 AM

I found a way to manage this, downloading this module:


Then, you overrided the one2many whose order you want to alter, in your case the field was line_id.


Good Luck :)

Is it applicable for the id of account I'd?

Anirudh Lou
on 8/3/15, 6:33 AM

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

1 follower(s)


Asked: 8/3/15, 1:34 AM
Seen: 2105 times
Last updated: 8/11/15, 5:58 PM