From 9a4e51673d38125dc8e3601f0c804602e15f6dee Mon Sep 17 00:00:00 2001 From: ced <> Date: Wed, 5 Sep 2007 14:03:04 +0000 Subject: [PATCH] Fix name_get on account_bank_statement_reconcile - Use the currency of the bank statement bzr revid: ced-5ceacdf60ec4430246e211166f25805b598f3899 --- addons/account/account_bank_statement.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/addons/account/account_bank_statement.py b/addons/account/account_bank_statement.py index 25ce3338c51..8afb67b6195 100644 --- a/addons/account/account_bank_statement.py +++ b/addons/account/account_bank_statement.py @@ -411,9 +411,12 @@ class account_bank_statement_reconcile(osv.osv): company_currency_id = res_users_obj.browse(cursor, user, user, context=context).company_id.currency_id.id - currency_id = context.get('currency_id', company_currency_id) for o in self.browse(cursor, user, ids, context=context): + if o.statement_line: + currency_id = o.statement_line[0].statement_id.currency.id + else: + currency_id = company_currency_id res.append((o.id, '[%.2f/%.2f]' % ( res_currency_obj.compute(cursor, user, company_currency_id, currency_id, o.total_entry, context=context), @@ -443,6 +446,8 @@ class account_bank_statement_reconcile(osv.osv): 'total_balance': fields.function(_total_balance, method=True, string='Balance'), #line_ids define in account.py + 'statement_line': fields.one2many('account.bank.statement.line', + 'reconcile_id', 'Bank Statement Line'), } _defaults = { 'name': lambda *a: time.strftime('%Y-%m-%d'),