El lunes, 15 de junio de 2015, 12:35:04 (UTC+1), Antonio Roncero escribió:
>
> Hi,
>
>
I answer to myself.
> i want to write a report from proteus. I use the code below
>
> def download_invoice(invoice_id):
> report=Report('account.invoice')
> Invoice = Model.get('account.invoice')
> invoices = Invoice.find(condition=['id','=',invoice_id])
> type_, data, print_, name = report.execute(invoices, {})
> target = open(name+'.odt', 'w')
> newFileByteArray = bytearray(data)
>
newFileByteArray = bytearray(str(data))
target.write(newFileByteArray)
>
>
> The file 'Invoice - FV0005.odt' is created fine but is emty. What is the
> correct way to do it?
>
> Thanks
>