You can give 'name': 'Invoice ' + 'today date' in return from wizard to print report.
for example: this is function is call from print button in wizard.
def print_report(self,cr, uid, ids, context=None):
if context is None:
context = {}
data = self.read(cr, uid, ids)[0]
self_browse = self.browse(cr, uid, ids)
datas = {
'ids': [data.get('id')],
'model': 'sale.order',
'form': data
}
return {
'type': 'ir.actions.report.xml',
'report_name': 'custom.invvoice.report',
'datas': datas,
'name': 'Invoice ' + self_browse[0].start_date + ' To ' + self_browse[0].end_date
}
if context is None:
context = {}
data = self.read(cr, uid, ids)[0]
self_browse = self.browse(cr, uid, ids)
datas = {
'ids': [data.get('id')],
'model': 'sale.order',
'form': data
}
return {
'type': 'ir.actions.report.xml',
'report_name': 'custom.invvoice.report',
'datas': datas,
'name': 'Invoice ' + self_browse[0].start_date + ' To ' + self_browse[0].end_date
}
give me xml file . i can't this datas view in xml
ReplyDeleteWhat should I do if I want to name the outgoing pdf? For example Quotation_SO230.pdf
ReplyDeleteHello,
ReplyDeleteIf you dont want to code like this then, you can also install this module find below.
https://www.odoo.com/apps/modules/8.0/report_custom_filename/
this module helps you to change the name of report .
Thanks