Odoo Help

1

OpenERP Report over multiple purchase orders using openoffice / libreoffice

By
Raza Ali
on 3/10/13, 1:31 PM 1,654 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

1

Keyur

--Keyur--
1185
| 4 4 8
Ahmedabad, India
--Keyur--

Odoo Expert

Keyur
On 4/11/13, 7:07 AM

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.

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.'), ))

Andres Brigard
on 10/28/15, 8:27 PM
0
Andres Brigard
On 11/8/15, 10:12 PM

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>

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

2 follower(s)

Stats

Asked: 3/10/13, 1:31 PM
Seen: 1654 times
Last updated: 11/8/15, 10:12 PM