Search code examples
odooodoo-8qweb

Qweb report report_name not working


I can't change the default name for my pdf reports. It works if I do it in the settings but I don't want to do it this way. I tried by using report_name in my <report> but it says that report_name is not an element of report. I can't figure out how to do it.


Solution

  • For set-up custom name of qweb report you can set attachment attribute of report.

    Example is available if for invoice:

        <report 
            id="account_invoices"
            model="account.invoice"
            string="Invoices"
            report_type="qweb-pdf"
            name="account.report_invoice"
            file="account.report_invoice"
            attachment_use="True"
            attachment="(object.state in ('open','paid')) and ('INV'+(object.number or '').replace('/','')+'.pdf')"
        />
    

    Try to use module : https://www.odoo.com/apps/modules/8.0/report_custom_filename/

    Hope this helps.