Odoo Help

0

How to sort a list on a one2many fields?

By
Anirudh Lou
on 8/3/15, 1:34 AM 1,857 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.

1
Drees Far
On 8/3/15, 5:21 AM

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

https://www.odoo.com/apps/modules/7.0/one2many_sorted/

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

Regards.

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.

Register

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)

Stats

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