Odoo Help


File name change for Invoice report

on 7/16/15, 9:21 AM 1,006 views


I want to change the name of the downloaded invoice pdf file like "Invoice-(Invoice_Number.pdf". How can it be possible? I tried with the attachment configuration, it worked. But it is helpful for me at the time of sending the mail. But If I download the Invoice, it saves the pdf as Invoice.pdf. Please help me with a solution.




Ankit H Gandhi(AHG)

--Ankit H Gandhi(AHG)--

| 6 5 6
Baroda, India
--Ankit H Gandhi(AHG)--

Learning Python..

Ankit H Gandhi(AHG)
On 7/26/15, 6:35 AM

Dear Scot,

yes you can give 'name': 'Invoice -'+'('+'Invoice number' + ')' in return from wizard to print report.

for example: this is function is call from print button in wizard.

def custom_invoice_print(self, cr, uid, ids, context=None):

self.write(cr, uid, ids, {'sent': True}, context=context)

data = self.read(cr, uid, ids)[0]

self_browse = self.browse(cr, uid, ids)

datas = {

'ids': ids,

'model': 'account.invoice',

'form': self.read(cr, uid, ids[0], context=context)


return {

'type': 'ir.actions.report.xml',

'report_name': 'account.invoice2',

'datas': datas,

'name': 'Invoice- ' + '(' + self_browse[0].number + ')' ,

'nodestroy' : True


Result: Invoice- (INV14-09_018).pdf

Updated answer:

if you are use rml report then override the report tag like this

<report auto="False" id="sale.report_sale_order" model="sale.order" name="sale.order"

rml="sale/report/sale_order.rml" string="whatever you want to name of the report"


Hope this helpfully


Ankit H Gandhi.

Hi Ankit. Thanks for the help. But I donot have any wizard to the report. Only rml and python file. Just like Customer Invoice.

on 7/31/15, 8:48 AM

@ scot I updated my answer

Ankit H Gandhi(AHG)
on 8/2/15, 6:56 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

1 follower(s)


Asked: 7/16/15, 9:21 AM
Seen: 1006 times
Last updated: 8/2/15, 6:56 AM