Odoo Help


Temporary variable in aeroo report

Francesco OpenCode
on 4/12/13, 8:03 AM 5,062 views

I'm using aeroo report to create a report. I need to insert a temporary variable in a for cicle to incement with some values. It's possible this? Official documentation doesn't explain nothing about this.

Hi Fracesco, i faced the same problem, i found a roundabout by checking the template.ods file in the report_aeroo_printscreen module and how the parser works, it might help you!

SANOU Ibrahim
on 5/28/13, 7:12 AM

I will see the code of this module. Thanks.

Francesco OpenCode
on 5/28/13, 8:56 AM



| 5 5 8
Bogotá, Colombia
Informatics engineer Industrial engineer
On 6/28/13, 6:40 PM

I found this in aero reports forums http://www.alistek.com/forum/viewtopic.php?f=11&t=473&p=1590#p1590 it was really useful

first you have to define parser in the parser tab of your report:

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

def myset(self, pair):
        if isinstance(pair, dict):
        return False

def myget(self, key):
    if key in self.localcontext['storage'] and self.localcontext['storage'][key]:
        return self.localcontext['storage'][key]
    return False

then in the reports you can set a variable in this way:

<if test="myset({'test':50})"></if>

then you can call it with:


example to modify an already declared variable:

<if test="myset({'test':myget('test')+1})"></if>

yeah it's some way to achieve it, there are also loop options, but what i will really want alistek to do is to permitt the use of more than 2 column loops in the same sheet. I have almost lost all my hairs and was finally forced to use 3 sheets for my report instead of one!

SANOU Ibrahim
on 7/5/13, 7:54 AM

I probably do not know what you mean, because i can implement any x number of loops recursively or independent loops in the same column or row.

on 7/5/13, 11:29 AM

Felipe what I mean is for example suppose you have got two tables A & B you wanna make a report on these table lines and u wanna generate the table columns names dynamically (loop on columns) in the same sheet, u'll have to do two different column loops in the same sheet!

SANOU Ibrahim
on 7/31/13, 12:13 PM

10000 thanks !!!

I spent an all day trying to make sumif() working, and I still cannot manage to make it working

Now I managed to do what I needed in 5 min thanks to this tip.

Many thanks .

Thierry Godin
on 12/14/13, 3:22 PM

thumb up if it was of any help ;)

on 12/14/13, 7:45 PM

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.


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

0 follower(s)


Asked: 4/12/13, 8:03 AM
Seen: 5062 times
Last updated: 5/24/17, 4:56 AM