In generating report/print instead of downloading odt it will convert to pdf and the pdf file will be downloaded directly? by the way i'm using sao client.
class InvoiceReport(Report):
__name__ = 'account.invoice'
@classmethod
def __setup__(cls):
super(InvoiceReport, cls).__setup__()
cls.__rpc__['execute'] = RPC(False)
@classmethod
def execute(cls, ids, data):
Invoice = Pool().get('account.invoice')
result = super(InvoiceReport, cls).execute(ids, data)
invoice = Invoice(ids[0])
if len(ids) > 1:
result = result[:2] + (True,) + result[3:]
else:
if invoice.number:
result = result[:3] + (result[3] + ' - ' + invoice.number,)
if invoice.invoice_report_cache:
result = (invoice.invoice_report_format,
invoice.invoice_report_cache) + result[2:]
else:
# If the invoice is posted or paid and the report not saved in
# invoice_report_cache there was an error somewhere. So we save it
# now in invoice_report_cache
if invoice.state in {'posted', 'paid'} and invoice.type == 'out':
invoice.invoice_report_format, invoice.invoice_report_cache = \
result[:2]
invoice.save()
return result
the oext in result or the output extension is in pdf. But still the odt is downloaded.