Odoo Help

0

Change pdf name of Qweb report

By
OpenWorks
on 7/6/15, 8:01 AM 1,883 views

How to change the pdf file name generated by qweb report?

0
Gustavo Hinojosa
On 5/11/16, 3:13 PM

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',

}

0

Temur

--Temur--
2932
| 6 5 7
Tbilisi, Georgia
--Temur--
Programmer
Temur
On 7/6/15, 8:28 AM

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.

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.

Register

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)

Stats

Asked: 7/6/15, 8:01 AM
Seen: 1883 times
Last updated: 5/11/16, 3:13 PM