Priyesh (OpenERP) has proposed merging
lp:~openerp-dev/openobject-addons/5.0-opw-7285-pso into
lp:openobject-addons/5.0.
Requested reviews:
Raphael Collet (OpenERP) (rco-openerp)
For more details, see:
https://code.launchpad.net/~openerp-dev/openobject-addons/5.0-opw-7285-pso/+merge/76019
Hello,
Improved balance computation of bank statement for multi-currency (case:7285)
To reproduce:
1. Currency of Bank Journal = ARS, Company currency = EUR
2. Create a Bank statement (so it's currency = ARS)
3. Create a start balance = 0 ans end balance = 100
4. Create entry lines: First line with 20, and second line with 80 (so these
amounts are in ARS)
5. Confirm the bank Statement
6. The Balance will be correct (100), and on Real entries tab, you'll lines
with amounts converted in EUR
7. Now change the ARS rate (date = today)
8. Go back to the Confirmed Bank Statement and reload it, you'll face the
problem that the Balance changed...so the balance is now not correct anymore
Thanks,
Priyesh
--
https://code.launchpad.net/~openerp-dev/openobject-addons/5.0-opw-7285-pso/+merge/76019
Your team OpenERP R&D Team is subscribed to branch
lp:~openerp-dev/openobject-addons/5.0-opw-7285-pso.
=== modified file 'account/account_bank_statement.py'
--- account/account_bank_statement.py 2010-11-04 15:09:45 +0000
+++ account/account_bank_statement.py 2011-09-19 12:42:39 +0000
@@ -57,18 +57,19 @@
res[statement.id] = statement.balance_start
currency_id = statement.currency.id
for line in statement.move_line_ids:
- if line.debit > 0:
- if line.account_id.id == \
- statement.journal_id.default_debit_account_id.id:
- res[statement.id] += res_currency_obj.compute(cursor,
- user, company_currency_id, currency_id,
- line.debit, context=context)
+ if currency_id == company_currency_id:
+ if line.debit > 0:
+ if line.account_id.id == \
+ statement.journal_id.default_debit_account_id.id:
+ res[statement.id] += line.debit
+ else:
+ if line.account_id.id == \
+ statement.journal_id.default_credit_account_id.id:
+ res[statement.id] -= line.credit
else:
- if line.account_id.id == \
- statement.journal_id.default_credit_account_id.id:
- res[statement.id] -= res_currency_obj.compute(cursor,
- user, company_currency_id, currency_id,
- line.credit, context=context)
+ if line.amount_currency > 0:
+ res[statement.id] += line.amount_currency
+
if statement.state == 'draft':
for line in statement.line_ids:
res[statement.id] += line.amount
_______________________________________________
Mailing list: https://launchpad.net/~openerp-dev-gtk
Post to : [email protected]
Unsubscribe : https://launchpad.net/~openerp-dev-gtk
More help : https://help.launchpad.net/ListHelp