[FIX] Account voucher: Amount reconciled field on bank statement line (Voucher amount already converted to currecny amount if its multicurrency)

bzr revid: mra@mra-laptop-20100929094119-g6agj50f6ghhos8w
This commit is contained in:
Mustufa Rangwala 2010-09-29 15:11:19 +05:30
parent 1ebc0a6c07
commit 3750db76b5
1 changed files with 7 additions and 6 deletions

View File

@ -852,17 +852,18 @@ class account_bank_statement_line(osv.osv):
def _amount_reconciled(self, cursor, user, ids, name, args, context=None):
if not ids:
return {}
res_currency_obj = self.pool.get('res.currency')
res = {}
company_currency_id = False
for line in self.browse(cursor, user, ids, context=context):
if not company_currency_id:
company_currency_id = line.company_id.id
# if not company_currency_id:
# company_currency_id = line.company_id.id
if line.voucher_id:
res[line.id] = res_currency_obj.compute(cursor, user,
company_currency_id, line.statement_id.currency.id,
line.voucher_id.amount, context=context)
res[line.id] = line.voucher_id.amount#
# res_currency_obj.compute(cursor, user,
# company_currency_id, line.statement_id.currency.id,
# line.voucher_id.amount, context=context)
else:
res[line.id] = 0.0
return res