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

I'd like to create a custom filename for reports (eg. Quotation/Sales Order) including the document number and a timestamp, for example:

SO039_2015_04_25.pdf

I can see some functionality that achieves this in the email templates for Sales Orders here:

Settings >> Email > Templates >> [Search for Sale] >> Open and Edit [Sales Order - Send by Email]

Just go to the Advanced Settings tab and look for the field Report Filename which contains the following python expression:

${(object.name or '').replace('/','_')}_${object.state == 'draft' and 'draft' or ''}

I would like to use exactly this functionality for the regular print functions on the Sales >> Quotation >> Print >> Quotation / Order, as well as other reports using Aeroo Reports, and Jasper Reports.

Has anyone managed to figure out a way to do this in Odoo 8.0, or any other version of Odoo for that matter?

الصورة الرمزية
إهمال
الكاتب

for anyone looking to do the same thing I have come across a module built by Holger Brunn that makes it easier to do this:

https://github.com/OCA/reporting-engine/tree/8.0/report_custom_filename

Using the following example I can create output for a filename for Sales Order/Quotation:
${(object.name or '').replace('/','_')}_${object.state == 'draft' and 'draft' or '' +'.xls'}

That looks like this:

SO039_.xls

I'll update this thread with more information as I figure out how to use it.

الكاتب

this forum thread may be useful for others interested in doing this:

https://www.odoo.com/forum/help-1/question/save-as-attachment-prefix-doesnt-work-26376

أفضل إجابة

Hi,

You can do that easily by installing this app :

https://apps.odoo.com/apps/modules/8.0/report_custom_filename/

you can use the expressions you mentionned in the field :  Download filename  located in the form view of your report.

Hope that answers the question.

And vote if you find it useful.

الصورة الرمزية
إهمال
المنشورات ذات الصلة الردود أدوات العرض النشاط
2
ديسمبر 24
1100
0
أبريل 22
2081
0
مارس 15
3487
3
مارس 24
20272
0
مارس 22
2