Multiple currency bank accounts
Nowadays banks allow the co-existence of multiple currencies in one single bank account. Banks differ in approach how to report the total amounts in the various currencies. Virtual single currency reporting, mixed currency reporting and 'statement wise' single currency reporting are all signaled.
The account banking framework should be extended to handle reports like this. This will affect account_
Blueprint information
- Status:
- Started
- Approver:
- None
- Priority:
- Undefined
- Drafter:
- None
- Direction:
- Needs approval
- Assignee:
- None
- Definition:
- Approved
- Series goal:
- None
- Implementation:
- Slow progress
- Milestone target:
- None
- Started by
- Pieter J. Kersten (EduSense BV)
- Completed by
Related branches
Related bugs
Bug #514297: Currency field is not being stored | Fix Committed |
Bug #514305: Nowadays it is common that one bank account may service multiple currencies | Invalid |
Sprints
Whiteboard
Sraps has some preliminary work offered which has to be evaluated and incorporated.
Here is the patch which solves the problem:
diff -urNp account_
--- account_
+++ account_
@@ -32,6 +32,7 @@ from tools.translate import _
from account_
from account_
from banktools import *
+from account_
def _get_move_
reconcile_obj = pool.get(
@@ -286,9 +287,10 @@ def _banking_
- if not statement.
+ info_key = statement.
+ if not info_key in info:
- pool, cursor, uid, statement.
+ pool, cursor, uid, statement.
)
if not account_info:
@@ -307,9 +309,9 @@ def _banking_
- info[statement.
+ info[info_key] = account_info
else:
- account_info = info[statement.
+ account_info = info[info_key]
if statement.
and account_
diff -urNp account_
--- account_
+++ account_
@@ -135,7 +135,7 @@ def get_or_
partner_id = partner_ids[0]
return partner_
-def get_company_
+def get_company_
'''
Get the matching bank account for this company.
@@ -154,9 +154,19 @@ def get_company_
return False
results.
bank_
+ journal_obj = pool.get(
+ default_currency = pool.get(
+ journal_ids = journal_
+ ('type', '=', 'cash')
+ ])
+ if not journal_ids and currency == default_currency:
+ journal_ids = journal_
+ ('type', '=', 'cash')
+ ])
bank_
- ('partner_bank_id', '=', bank_account.id)
+ ('partner_bank_id', '=', bank_account.
])
+
if bank_settings_ids:
settings = bank_settings_