Odoo Help


[8.0] How can I create a custom report filename for Odoo (eg. SO039_2015_04_25.pdf)?

Luke Branch
on 4/24/15, 6:35 AM 2,364 views

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


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:


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:


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

Luke Branch
on 4/28/15, 4:03 AM

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


Luke Branch
on 4/28/15, 4:05 AM

About This Community

This platform is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.


Odoo Training Center

Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.

Test it now

Question tools

3 follower(s)


Asked: 4/24/15, 6:35 AM
Seen: 2364 times
Last updated: 8/31/15, 3:23 AM