Odoo Help

0

How to group by account from resulted search ids?

By
vadivel
on 12/7/15, 12:18 AM 637 views

Hi,

Im working odoo version 7.0.I need a solution for below given problem.I have searched and got some ids of account_move.Now i will browse by this ids from same(account_move) class.when i iterate these ids i will get all of account_move_line ids of relevant move_ids.

j_ids=journal_obj.search(cr,uid,[('company_id','=',context['uid']),('state','=','posted'),('date','>=',d1),('date','<=',d2)], order='date asc')

journals=journal_obj.browse(cr,uid,j_ids)

for jnal in journals:

    for j_line in jnal.line_id

I need them to be grouped by account (not by ids) and to be printed in report.I have posted my code.Please suggest me some solutions.Thanks in advance.


0
Temur
On 12/7/15, 9:31 AM

Try to use context for it:

 context="{'group_by':'field_name_to_group_by'}"
pass  this context when you search / browse for records.

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: 12/7/15, 12:18 AM
Seen: 637 times
Last updated: 12/7/15, 9:31 AM