From 8305880f74ab932d3ad01d4a0d690dd1b776bcc4 Mon Sep 17 00:00:00 2001 From: Stefan Rijnhart Date: Thu, 31 Oct 2013 10:25:28 +0100 Subject: [PATCH] [FIX] AccessError on confirming bank statements of a child company (Workaround for lp:1246642) --- account_banking/banking_import_transaction.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/account_banking/banking_import_transaction.py b/account_banking/banking_import_transaction.py index bd1a371c4..a94e40ef6 100644 --- a/account_banking/banking_import_transaction.py +++ b/account_banking/banking_import_transaction.py @@ -1892,7 +1892,13 @@ class account_bank_statement_line(osv.osv): if st_line.import_transaction_id: import_transaction_obj.confirm( cr, uid, st_line.import_transaction_id.id, context) - st_line.refresh() + # Workaround for + # https://bugs.launchpad.net/openobject-server/+bug/1238042 + # Need to rebrowse instead of refresh, because any parent company + # will be in the browse record's id cache after the first pass, and + # accessing the actual company will then trigger a read attempt on + # the inaccessible parent company too, leading to an access error. + st_line = self.browse(cr, uid, st_line.id, context=context) st_line_number = statement_pool.get_next_st_line_number( cr, uid, st_number, st_line, context) company_currency_id = st.journal_id.company_id.currency_id.id