Help

2

how to create aeroo report template

iam newbie to openerp . Currently iam working on aeroo reports. i gone through several videos & tutorials but doesnt helped me. can you please help me out creating aeroo reports.

Avatar
Discard
1 Answer
1
Avatar
Andres Brigard
Best Answer

Hi I am far from being an expert. But I will try to help you:

1) Aeroo Report report definition: 

Once you have installed the aeroo reports module you go to Configuration -> Technical -> Aeroo Reports -> Reports -> Create Report

2) Fill the fields as I show below:

Name:
name of the report
Model:
module.table
Template Name:
any name

In  Generic tab -> Template: Mime-type and Output Mime-type select the appropriate options: pdf, odt, etc.

Template Source: File and in Template path: template of the file and filename something like:  operations/report/PrintReport.odt. It is the relative path to the Add ons path. The other fields I leave them blank.

Advanced tab:

Process Separately ( ) and Active (x)

State of Parser : File and in Parser location : the path and name of the python file, in my case: operations/report/parser.py.

This is the code for parser.py I have used:

import logging
logger = logging.getLogger('report_aeroo')

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)
# extra code to be able to iterate over selected rows
model = self.pool.get(context['active_model'])
ids = context['active_ids']
rows = model.browse(cr, uid, ids, context=context)
self.localcontext.update({
'rows': rows
})

Maybe you can select Definition in State of Parser and the code that comes is the same without the from definitions.


3) The you create an odt file with Libre/Open Office. Following the instructions in this video.

https://www.youtube.com/watch?v=wAKPB9dRC-Y&list=PLF2BFB67915E6CAF8&index=4


4) Try the report:

Go to the button (More) and press the option Test the report. Then a wizard pops up asking for an ID. If you do not know the ID you can export some records of the table using the export option to Excel and the first column is the ID. You can use this number.


5) Create the report entry in the Print Button:

Goto the More Button and select Add Print Button. Reload the browser window and the report should show up.


Tell me if that works. Good luck.

Avatar
Discard