تخطي للذهاب إلى المحتوى
القائمة
لقد تم الإبلاغ عن هذا السؤال
5374 أدوات العرض

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!

الصورة الرمزية
إهمال

hi

create your function in order.py and called in rml

الكاتب

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!

المنشورات ذات الصلة الردود أدوات العرض النشاط
3
يوليو 24
8601
0
أبريل 17
3315
1
أبريل 17
4681
2
نوفمبر 15
5000
0
مارس 15
4776