From 6b45f7686895be86951c966a7bfb335372de23b6 Mon Sep 17 00:00:00 2001 From: Vincent Vinet Date: Tue, 26 Aug 2014 13:10:18 -0400 Subject: [PATCH] add amount in currency in separate column --- .../npg_bank_account_reconciliation.py | 13 ++++++------- .../npg_bank_account_reconciliation_view.xml | 4 ++++ 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/npg_bank_account_reconciliation/npg_bank_account_reconciliation.py b/npg_bank_account_reconciliation/npg_bank_account_reconciliation.py index b1a5758fc..fea098295 100644 --- a/npg_bank_account_reconciliation/npg_bank_account_reconciliation.py +++ b/npg_bank_account_reconciliation/npg_bank_account_reconciliation.py @@ -218,13 +218,10 @@ class bank_acc_rec_statement(osv.osv): 'type': line.credit and 'cr' or 'dr' } - if all((line.currency_id, - line.company_id, - line.currency_id.id != line.company_id.currency_id.id)): - if line.credit: - res['amount'] = -line.amount_currency - else: - res['amount'] = line.amount_currency + if line.credit: + res['amount_in_currency'] = -line.amount_currency + else: + res['amount_in_currency'] = line.amount_currency return res @@ -390,6 +387,8 @@ class bank_acc_rec_statement_line(osv.osv): 'partner_id': fields.many2one('res.partner', string='Partner', help="Derived from related Journal Item."), 'amount': fields.float('Amount', digits_compute=dp.get_precision('Account'), help="Derived from the 'debit' amount from related Journal Item."), + 'amount_in_currency': fields.float('Amount in Currency', digits_compute=dp.get_precision('Account'), + help="Amount in currency from the related Journal Item."), 'date': fields.date('Date', required=True, help="Derived from related Journal Item."), 'statement_id': fields.many2one('bank.acc.rec.statement', 'Statement', required=True, ondelete='cascade'), 'move_line_id': fields.many2one('account.move.line', 'Journal Item', help="Related Journal Item."), diff --git a/npg_bank_account_reconciliation/npg_bank_account_reconciliation_view.xml b/npg_bank_account_reconciliation/npg_bank_account_reconciliation_view.xml index 7faf3babc..7934fcdb9 100644 --- a/npg_bank_account_reconciliation/npg_bank_account_reconciliation_view.xml +++ b/npg_bank_account_reconciliation/npg_bank_account_reconciliation_view.xml @@ -57,6 +57,7 @@ + @@ -67,6 +68,7 @@ + @@ -81,6 +83,7 @@ + @@ -91,6 +94,7 @@ +