How to change the pdf file name generated by qweb report?
Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:
- CRM
- e-Commerce
- Accounting
- Inventory
- PoS
- Project management
- MRP
This question has been flagged
Go to page "Settings/Technical/Actions/Reports"
here you can open corresponding record you want to change file name for and edit a "Save as Attachment Prefix" field (when you hover this fields name with mouse pointer, it'll display a tooltip help message). by changing this field, you'll change filename of the attachment saved. you can use python expressions here, as for example in Invoices pdf.
hope it'll help.
Hi,
have my own custom module and I inherit qweb report for invoicing. I use in my inherit this code in the begging:
How you can see I inherit report_invoice_document. Everything works fine but I would like to change the PDF File name. I know how do this from Setting -> Technical -> Reports and change Report Printed Name, but I do not have idea how I can define new name in my custom module.When I click on invoice in Print Menu the file name is "<number-of-invoice>.pdf", but I want to change to "Invoice-<number-of-invoice>.pdf". For example from 333.pdf to be Invoice-333.pdf.
Thank you a lot!
Hi, hope you help.
@api.multi def print_qr_report_medio_oficio(self): report_obj = self.env['report'] # Instanciando el modelo report = report_obj._get_report_from_name('ew_qr_sale.ew_reporte_factura_qr_hoja_medio_oficio') # Obteniendo el modelo nombre_factura = 'name_report - nr' report.name = nombre_factura # Cambiando el nombre a la factura return { 'type': 'ir.actions.report.xml', 'report_name': 'ew_qr_sale.ew_reporte_factura_qr_hoja_medio_oficio', 'report_type': u'qweb-pdf', } |
Enjoying the discussion? Don't just read, join in!
Create an account today to enjoy exclusive features and engage with our awesome community!
Sign upRelated Posts | Replies | Views | Activity | |
---|---|---|---|---|
|
2
Sep 24
|
255 | ||
|
5
Aug 19
|
45067 | ||
|
4
Jun 18
|
17980 | ||
|
0
Jun 18
|
2331 | ||
|
2
May 16
|
14959 |