Odoo Help

Welcome!

This community 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.

2

how to create aeroo report template

By
shashank verma
on 5/24/13, 7:33 AM 1,502 views

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.

1
Andres Brigard
On 10/28/15, 8:05 PM

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.

Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

About This Community

This community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

3 follower(s)

Stats

Asked: 5/24/13, 7:33 AM
Seen: 1502 times
Last updated: 11/8/15, 10:18 PM