This question has been flagged
4 Replies
9166 Views

I'm currently using v 6.1. If i go to reports and fill field 'Save as attachment prefix' i. e. 'SO' next time i print this report it still has old name even after server restart. After investigation it appears that filename comes from Service name defined in report and this Service is registered each time you start the server. I tried to change this filename , even had success but the problem is that my code is rewriting report_name field each_time you print it and filename appears with one step back. Does anyone faced the same problem? Any help will be appreciated.

Avatar
Discard

how did you give the prefix name?

Best Answer

having similar problem. the value from the field "Save as Attachment Prefix" is never used. Actually the PDF should also be persisted to the "Attachments", if a prefix is specified, but also this doesn't work.

my prefix for a Purchase Order is: ((object.name) + '_' + (object.state) + '_' + (time.ctime()) + ('.pdf'))

but I also tried a simple one like ('PO.pdf')

Avatar
Discard
Best Answer

For pyhon shell syntax training, try this:

pyhon
>>> import time
>>> print "%s" % time.ctime()                               >>Sun Sep  7 22:05:46 2014
>>> print "%s" % time.ctime().split()[4]                >>2014
CTRL-D for quit shell

 

For attach pdf Sale Order in state 'progress' or 'manual' or 'done' with name 'SO001-2014.pdf', my prefix is:

(object.state in ('progress','manual','done')) and ((object.name or '').replace('/','')+'-'+ time.ctime().split()[4] +'.pdf')

 

 

Avatar
Discard

@Michel,

Thanks, your prefix helped me partially get where I wanted to go in 8.0, however i'd like to ask if you know if it is possible to create a custom filename in this manner for printing in Aeroo Reports.

What I would like to do is have the Document state (eg. PO), document number (eg. 123456), and then a date/timestamp of when it was printed (eg. 2015-04-18#11_45) as the filename. So in my example above:

PO_123456_2015-04-18#11_45.xls

I'm just getting to grips with Aeroo, and it's an awesome little reporting engine, but I haven't managed to figure out this one yet. If you have time, any insight or advice would be very appreciated.

Best Answer

please try with something like this:

(object.state in ('draft','approved')) and ('RfQ_'+(object.name + '_' + time.ctime()).replace('/','')+'.pdf')

Regards

claudio

Avatar
Discard
Best Answer

I had simmilar problem, and finaly foud it out to be a strange bug... On fist print the document name is rendered correct, and stored with correct name, but the file that is downloaded after fisrt rendering is having OLD name value, so the first time you download the attachment it has wrong filename. Also, after downloading, check the name of attachment (clicking on attachments button on top of document page and there the name of document shows up corectly)... 
Instead of rewriting javascript that downloads the document, i just discard the first download, and download it againg from attachment so it gets the desired filename.. 
 

 

Avatar
Discard