This question has been flagged

Hi all,

I'm trying to insert a column into addons/purchase/report/order.rml so that every line of the purchase order starts with a consecutive number.

The trouble is that the report uses data from the database and these numbers are neither there nor shall be there. The only sensible thing to to would be to generate these numbers on the fly for every report.

I tried to do this in the RML file itself but this does not work. It seems that the code executed between the square brackets is local for this execution - I cannot define a "global" variable, increment it and print it's value on each row. I searched the internet but cannot seem to found an answer. How shall I go about this problem?

Thanks in advance!

Avatar
Discard

hi

create your function in order.py and called in rml

Author

Hi, thank you for the quick answer! I have some difficulties implementing it though. I tried to add the free function to addons/purchase/report/order.py as well to addons/purchase/report/purchase_report.py to no avail. Can you please point me to an example of calling such a self-made function in RML? Thanks!