This question has been flagged
3 Replies
4161 Views

I was able to add a report record for object purchase.order. It shows up when I select and open a specific PO.

How do I print a report over multiple purchase orders, or multiple stock moves, or multiple sales orders etc.?

What do I specify in "object" (model) for the report record and where would this print menu show up?

(I am using aeroo reports engine and I was able to specify a <for each..> ... </for> loop but it only prints one record (which is the currently selected PO).

Thanks

Avatar
Discard
Best Answer

By creating a wizard in which you are able to select multiple Purchase Orders or stock moves or sales orders and can generate report accordingly otherwise it could be done by using search method in report.py file.By search method you can to find specific purchase orders or stock moves or sales orders.

Avatar
Discard

I have a report working ok, when I add ... I get an error: except_orm: (u'Aeroo Reports: Error while generating the report.\nlist index out of range\nlist index out of range\nFor more reference inspect error logs.', (, Exception('Aeroo Reports: Error while generating the report.', IndexError('list index out of range',), 'list index out of range', 'For more reference inspect error logs.'), ))

Best Answer

I was finally able to do it by changing the parser file: This was the parser file that worked for me:

It prints the selected records as different rows in the same page.

from openerp.report import report_sxw
from openerp.report.report_sxw import rml_parse

class Parser(rml_parse):
def __init__(self, cr, uid, name, context):
super(self.__class__, self).__init__(cr, uid, name, context)

model = self.pool.get(context['active_model'])
ids = context['active_ids']
rows = model.browse(cr, uid, ids, context=context)
self.localcontext.update({
'rows': rows
}) 


The for sentence would be:

<for each="r in rows">
<r.field1> <r.field2> etc.
</for>
Avatar
Discard