try following:
do not change anything in original source code, then:
1. go to "Settings/Technical/Actions/Reports" page
2. find an action record that generates the PDF you're interested in.
3. As you find correct record, change it's "Save as Attachment Prefix" field as you like.
UPDATE:
- above solution applies to pdf attachment that's saved in the database but does not apply for the pdf you download immediately after click on "Print" button in the invoice form. As it's noted in comments, you can download this invoice pdf with a preconfigured name from attachments.
What it concerns name of file that's immediately downloaded after click on the "Print" button in invoice form, most probably it requires customization.
- Python tip (take look of report's controller):
### fseudo import: import report as re
### see: how-to-import-odoo-module-in-another-module
class ReportController(re.controllers.main.ReportController):
@route(['/report/download'])
def report_download(self, data, token):
response = super(ReportController, self).report_download(data,token)
file_download_name = "Whatever you like"
if "you have to handle this case(response != None, request type == 'qweb-pdf' etc...)":
response.headers.set('Content-Disposition', 'attachment; filename=%s.pdf;' % file_download_name)
return response
this will cause downloaded file to have name: "Whatever you like.pdf"
actually it's not a complete solution, of course you'll need to somehow generate meaningful filename (the variable file_download_name in the code above), also it's possible that there is better place for this kind of intervention than report_download function... good luck