Hey Guys

Need Help. 

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.

I have also check the result for this code

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. 

-- 
You received this message because you are subscribed to the Google Groups 
"tryton" group.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tryton/7e2efbf5-4e67-4b93-9a88-f6a115a19e83%40googlegroups.com.

Reply via email to