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.
Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:
- CRM
- e-Commerce
- Kế toán
- Tồn kho
- PoS
- Project
- MRP
Câu hỏi này đã bị gắn cờ
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)
self.localcontext.update({
'myset':self.myset,
'myget':self.myget,
'storage':{}
})
def myset(self, pair):
if isinstance(pair, dict):
self.localcontext['storage'].update(pair)
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:
<myget('test')>
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!
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.
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!
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 .
thumb up if it was of any help ;)
Bạn có hứng thú với cuộc thảo luận không? Đừng chỉ đọc, hãy tham gia nhé!
Tạo tài khoản ngay hôm nay để tận hưởng các tính năng độc đáo và tham gia cộng đồng tuyệt vời của chúng tôi!
Đăng kýBài viết liên quan | Trả lời | Lượt xem | Hoạt động | |
---|---|---|---|---|
|
0
thg 9 15
|
4112 | ||
|
1
thg 1 24
|
4774 | ||
|
1
thg 9 17
|
5430 | ||
|
2
thg 9 17
|
6176 | ||
|
0
thg 3 15
|
3465 |
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!
I will see the code of this module. Thanks.