I'm making reports using qWeb in Odoo 8. Those generated PDF files are saved with a "default" name. I would like to set a specific name to every generated file (not after file was saved, but in "generation" time).
Is that possible? If it is, how to do it?
Thanks in advance.
In General Qweb Report the Menu you can print your Qweb Report in Odoo 8.0
In
<report>
Tag has the different attributes for print the report in Qweb If you want to change the name of your printed PDF then the name Attribute is more important for us.Based on the name attribute our report PDF File name comes over hear in generalize one you should set the name attribute base on your_module_name.report_name
If you want to change your customize name of your PDF File then change the name attribute as per your sweet report name.
I hope this should helpful for you ..:)
is correct for string name is a print PDF name done
I think this was a bug which was fixed in version 9. Simply replace the contents of addons\report\controllers\main.py with this https://github.com/odoo/odoo/blob/9.0/addons/report/controllers/main.py and then restart the odoo server
you can use 'custom file name' module
select your report and change the name ..
Easy Way to change report PDF file name in Odoo v10:
Just add this code where you write the report tag, and give same ID in both, report and new added record. Like the following:
It will print the report file as
SALES_SO004.pdf
, whereSO004
is your sale or quotation number.In Odoo 8 you can patch the method report_download of addons/report/controllers/main.py like below (between FIX START and END). It will then use the code for the attachment attribute in the report action definition. As the system will then always also save the file as an attachment in the database you can change the behaviour further to only save in the database when attachment_use is set to True. In this way no extra fields need to be added and views changed.
You can set the attachment attribute of a report action for example in this way:
This is the patch of _check_attachment of the Report object in addons/report/report.py to modify the attachment_use behaviour: