From a5bdab3583bf5bdb5178fed7ddbc9833dcea07d1 Mon Sep 17 00:00:00 2001 From: Udo Spallek Date: Wed, 13 Apr 2011 14:48:46 +0200 Subject: [PATCH] Start a new transaction to store the resulting report for issue1826. --- invoice.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/invoice.py b/invoice.py index 39c5177497..f29533aa38 100644 --- a/invoice.py +++ b/invoice.py @@ -2072,10 +2072,12 @@ class InvoiceReport(Report): #If the invoice is open or paid and the report not saved in invoice_report #there was an error somewhere. So we save it now in invoice_report if invoice.state in ('open', 'paid'): - invoice_obj.write(invoice.id, { - 'invoice_report_format': res[0], - 'invoice_report': base64.encodestring(res[1]), - }) + with Transaction().new_cursor() as transaction: + invoice_obj.write(invoice.id, { + 'invoice_report_format': res[0], + 'invoice_report': base64.encodestring(res[1]), + }) + transaction.cursor.commit() return res InvoiceReport()