From 97cf13c5f470ac59604852bdb5ef74b134968e7c Mon Sep 17 00:00:00 2001
From: "Pieter J. Kersten"
Date: Tue, 23 Feb 2010 19:51:10 +0100
Subject: [PATCH] [FIX] account_banking: SWIFT online database is now image
protected [FIX] account_banking: res_partner_bank.search ignored count search
[FIX] account_banking: res_partner_bank.search could return random search
[IMP] account_banking: improved _founder code for dynamic environment [IMP]
account_banking: added skeleton code for Belgian BIC/IBAN service [IMP]
account_banking_nl_clieop: now takes partner address if account holder
is unknown
---
account_banking/account_banking.py | 18 +-
account_banking/i18n/account_banking.pot | 274 +++++++++++-------
account_banking/i18n/en_US.po | 274 +++++++++++-------
account_banking/i18n/nl_NL.po | 2 +-
account_banking/sepa/online.py | 40 +++
account_banking/wizard/banktools.py | 12 +-
.../wizard/export_clieop.py | 5 +-
7 files changed, 395 insertions(+), 230 deletions(-)
diff --git a/account_banking/account_banking.py b/account_banking/account_banking.py
index 9c5716163..7d33e38c2 100644
--- a/account_banking/account_banking.py
+++ b/account_banking/account_banking.py
@@ -92,6 +92,13 @@ class account_banking_account_settings(osv.osv):
'movements before confirming them.'
),
),
+ #'multi_currency': fields.boolean(
+ # 'Multi Currency Bank Account', required=True,
+ # help=('Select this if your bank account is able to handle '
+ # 'multiple currencies in parallel without coercing to '
+ # 'a single currency.'
+ # ),
+ #),
}
def _default_company(self, cursor, uid, context={}):
@@ -104,6 +111,7 @@ class account_banking_account_settings(osv.osv):
_defaults = {
'company_id': _default_company,
+ #'multi_currency': lambda *a: False,
}
account_banking_account_settings()
@@ -872,6 +880,7 @@ class res_partner_bank(osv.osv):
for i in range(len(mro)):
if mro[i].__module__.startswith('base.'):
self._founder = mro[i]
+ break
def create(self, cursor, uid, vals, context={}):
'''
@@ -910,7 +919,7 @@ class res_partner_bank(osv.osv):
return d.keys()
# Match acc_number searches as IBAN searches
- extras = [[('iban',) + x[1:] for x in args if x[0] == 'acc_number']]
+ extras = [('iban',) + x[1:] for x in args if x[0] == 'acc_number']
# Add local account search for IBAN searches
extra = []
@@ -925,12 +934,12 @@ class res_partner_bank(osv.osv):
if extra:
extras.append(extra)
- # Original search (grannies)
+ # Original search (_founder)
results = self._founder.search(self, cursor, uid, args, *rest, **kwargs)
for extra in extras:
results += self._founder.search(self, cursor, uid, extra, *rest,
**kwargs)
- return uniq(results)
+ return issubclass(results, list) and uniq(results) or results
def read(self, *args, **kwargs):
records = self._founder.read(self, *args, **kwargs)
@@ -998,7 +1007,8 @@ class res_partner_bank(osv.osv):
values['iban'] = unicode(iban_acc)
bank_id, country_id = get_or_create_bank(
self.pool, cursor, uid,
- info.bic or iban_acc.BIC_searchkey
+ info.bic or iban_acc.BIC_searchkey,
+ code = info.code, name = info.bank
)
values['country_id'] = country_id or \
country_ids and country_ids[0] or \
diff --git a/account_banking/i18n/account_banking.pot b/account_banking/i18n/account_banking.pot
index 0903ead00..9aa54a441 100644
--- a/account_banking/i18n/account_banking.pot
+++ b/account_banking/i18n/account_banking.pot
@@ -6,8 +6,8 @@ msgid ""
msgstr ""
"Project-Id-Version: OpenERP Server 5.0.7\n"
"Report-Msgid-Bugs-To: support@openerp.com\n"
-"POT-Creation-Date: 2010-01-08 15:30:50+0000\n"
-"PO-Revision-Date: 2010-01-08 15:30:50+0000\n"
+"POT-Creation-Date: 2010-02-19 16:17:51+0000\n"
+"PO-Revision-Date: 2010-02-19 16:17:51+0000\n"
"Last-Translator: <>\n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
@@ -16,7 +16,8 @@ msgstr ""
"Plural-Forms: \n"
#. module: account_banking
-#: wizard_view:account_banking.banking_import,import:0
+#: wizard_view:account_banking.banking_import,view_error:0
+#: wizard_view:account_banking.banking_import,view_statements:0
msgid "Results:"
msgstr ""
@@ -36,18 +37,19 @@ msgstr ""
msgid "Invalid model name in the action definition."
msgstr ""
-#. module: account_banking
-#: wizard_button:account_banking.banking_import,import,open:0
-msgid "_Open Statement"
-msgstr ""
-
#. module: account_banking
#: field:payment.line,date_done:0
msgid "Date Confirmed"
msgstr ""
#. module: account_banking
-#: wizard_button:account_banking.banking_import,import,end:0
+#: wizard_button:account_banking.banking_import,view_statements,open_statements:0
+msgid "_View Statements"
+msgstr ""
+
+#. module: account_banking
+#: wizard_button:account_banking.banking_import,view_error,end:0
+#: wizard_button:account_banking.banking_import,view_statements,end:0
msgid "_Close"
msgstr ""
@@ -106,14 +108,13 @@ msgstr ""
#. module: account_banking
#: code:addons/account_banking/wizard/bank_import.py:0
#, python-format
-msgid "Statement for account %(bank_account)s uses different '\n"
-" 'currency than the defined bank journal."
+msgid "Number of statements skipped due to errors"
msgstr ""
#. module: account_banking
-#: code:addons/account_banking/wizard/bank_import.py:0
+#: code:addons/account_banking/account_banking.py:0
#, python-format
-msgid "Number of statements skipped due to errors"
+msgid "Invalid IBAN account number!"
msgstr ""
#. module: account_banking
@@ -148,6 +149,12 @@ msgstr ""
msgid "Default debit account"
msgstr ""
+#. module: account_banking
+#: code:addons/account_banking/wizard/banktools.py:0
+#, python-format
+msgid "Unknown Bank"
+msgstr ""
+
#. module: account_banking
#: wizard_button:account_banking.banking_import,init,end:0
msgid "_Cancel"
@@ -168,6 +175,12 @@ msgstr ""
msgid "Confirmed"
msgstr ""
+#. module: account_banking
+#: model:ir.actions.act_window,name:account_banking.action_account_banking_res_partner_banks
+#: model:ir.ui.menu,name:account_banking.menu_action_account_banking_bank_accounts
+msgid "Bank Accounts"
+msgstr ""
+
#. module: account_banking
#: view:account.banking.account.settings:0
msgid "Default Accounts for Unknown Movements"
@@ -178,16 +191,16 @@ msgstr ""
msgid "Confirm"
msgstr ""
-#. module: account_banking
-#: field:account.banking.account.settings,default_credit_account_id:0
-msgid "Default credit account"
-msgstr ""
-
#. module: account_banking
#: code:addons/account_banking/wizard/bank_import.py:0
#, python-format
msgid "Statements found for account %(bank_account)s, '\n"
-" 'but no default journal was defined."
+" 'but no default journal was defined."
+msgstr ""
+
+#. module: account_banking
+#: field:account.banking.account.settings,default_credit_account_id:0
+msgid "Default credit account"
msgstr ""
#. module: account_banking
@@ -206,6 +219,13 @@ msgstr ""
msgid "Bank Transaction ID"
msgstr ""
+#. module: account_banking
+#: code:addons/account_banking/wizard/bank_import.py:0
+#, python-format
+msgid "Unable to link transaction %(trans)s to invoice: '\n"
+" '%(no_candidates)s candidates found; can't choose."
+msgstr ""
+
#. module: account_banking
#: code:addons/account_banking/wizard/bank_import.py:0
#, python-format
@@ -248,6 +268,18 @@ msgid "The Transactions File to import. Please note that while it is perfectly s
"To stay on the safe side, always load bank statements files using the same format."
msgstr ""
+#. module: account_banking
+#: field:account.banking.imported.file,state:0
+#: field:payment.line,export_state:0
+msgid "State"
+msgstr ""
+
+#. module: account_banking
+#: code:addons/account_banking/sepa/bbantoiban.py:0
+#, python-format
+msgid "This is a stub. Please implement your own code"
+msgstr ""
+
#. module: account_banking
#: constraint:ir.ui.view:0
msgid "Invalid XML for View Architecture!"
@@ -259,8 +291,9 @@ msgid "Imported Bank Statements"
msgstr ""
#. module: account_banking
-#: wizard_view:account_banking.banking_import,import:0
#: wizard_view:account_banking.banking_import,init:0
+#: wizard_view:account_banking.banking_import,view_error:0
+#: wizard_view:account_banking.banking_import,view_statements:0
msgid "Import Bank Transactions File"
msgstr ""
@@ -282,9 +315,10 @@ msgid "More then one possible match found for partner with name %(name)s"
msgstr ""
#. module: account_banking
-#: field:account.banking.imported.file,state:0
-#: field:payment.line,export_state:0
-msgid "State"
+#: code:addons/account_banking/wizard/bank_import.py:0
+#, python-format
+msgid "Statement for account %(bank_account)s uses different '\n"
+" 'currency than the defined bank journal."
msgstr ""
#. module: account_banking
@@ -294,15 +328,8 @@ msgid "ERROR!"
msgstr ""
#. module: account_banking
-#: code:addons/account_banking/wizard/banktools.py:0
-#, python-format
-msgid "No suitable period found for date %(date)s"
-msgstr ""
-
-#. module: account_banking
-#: code:addons/account_banking/wizard/banktools.py:0
-#, python-format
-msgid "Multiple overlapping periods for date %(date)s"
+#: field:account.bank.statement.line,currency:0
+msgid "Currency"
msgstr ""
#. module: account_banking
@@ -313,7 +340,8 @@ msgid "Company"
msgstr ""
#. module: account_banking
-#: wizard_field:account_banking.banking_import,import,log:0
+#: wizard_field:account_banking.banking_import,view_error,log:0
+#: wizard_field:account_banking.banking_import,view_statements,log:0
msgid "Log"
msgstr ""
@@ -328,65 +356,6 @@ msgstr ""
msgid "Configration Error !"
msgstr ""
-#. module: account_banking
-#: model:ir.module.module,description:account_banking.module_meta_information
-msgid "\n"
-" Module to do banking.\n"
-"\n"
-" This modules tries to combine all current banking import and export\n"
-" schemes. Rationale for this is that it is quite common to have foreign\n"
-" bank account numbers next to national bank account numbers. The current\n"
-" approach, which hides the national banking interface schemes in the\n"
-" l10n_xxx modules, makes it very difficult to use these simultanious.\n"
-" A more banking oriented approach seems more logical and cleaner.\n"
-"\n"
-" Changes to default OpenERP:\n"
-"\n"
-" * Puts focus on the real life messaging with banks:\n"
-" + Bank statement lines upgraded to independent bank transactions.\n"
-" + Banking statements have no special accountancy meaning, they're just\n"
-" message envelopes for a number of bank transactions.\n"
-" + Bank statements can be either encoded by hand to reflect the document\n"
-" version of Bank Statements, or created as an optional side effect of\n"
-" importing Bank Transactions.\n"
-"\n"
-" * Preparations for SEPA:\n"
-" + IBAN accounts are the standard in the SEPA countries\n"
-" + local accounts are derived from SEPA (excluding Turkey) but are\n"
-" considered to be identical to the corresponding SEPA account.\n"
-" + Banks are identified with either Country + Bank code + Branch code or BIC\n"
-" + Each bank can have its own pace in introducing SEPA into their\n"
-" communication with their customers.\n"
-" + National online databases can be used to convert BBAN's to IBAN's.\n"
-"\n"
-" * Adds dropin extensible import facility for bank communication in:\n"
-" + MultiBank (NL) format transaction files,\n"
-" - (todo) MT940 (Swift) format transaction files,\n"
-" - (todo) CODA (BE) format transaction files,\n"
-" - (wish) SEPA Credits (ISO 200022) messages,\n"
-"\n"
-" * Extends payments for digital banking:\n"
-" + Adapted workflow in payments to reflect banking operations\n"
-" + Relies on account_payment mechanics to extend with export generators.\n"
-" - ClieOp3 (NL) payment and direct debit orders files available as\n"
-" account_banking_nl_clieop\n"
-" - (wish) BTL91 (NL) payment orders files (no format description available),\n"
-" - (wish) SEPA Direct Debits (ISO 200022) messages\n"
-"\n"
-" * Additional features for the import/export mechanism:\n"
-" + Automatic matching and creation of bank accounts, banks and partners,\n"
-" during import of statements.\n"
-" + Automatic matching with invoices and payments.\n"
-" + Sound import mechanism, allowing multiple imports of the same\n"
-" transactions repeated over multiple files.\n"
-" + Journal configuration per bank account.\n"
-" + Business logic and format parsing strictly separated to ease the\n"
-" development of new parsers.\n"
-" + No special configuration needed for the parsers, new parsers are\n"
-" recognized and made available at server (re)start.\n"
-" "
-msgstr ""
-
#. module: account_banking
#: model:ir.actions.act_window,name:account_banking.act_account_payment_account_bank_statement
msgid "Bank Statements File"
@@ -398,6 +367,12 @@ msgstr ""
msgid "This is a stub. Please implement your own."
msgstr ""
+#. module: account_banking
+#: code:addons/account_banking/wizard/banktools.py:0
+#, python-format
+msgid "No suitable period found for date %(date)s and company %(company_name)s"
+msgstr ""
+
#. module: account_banking
#: view:account.banking.imported.file:0
#: model:ir.actions.act_window,name:account_banking.action_account_banking_imported_files
@@ -416,6 +391,12 @@ msgstr ""
msgid "Import Log"
msgstr ""
+#. module: account_banking
+#: code:addons/account_banking/wizard/banktools.py:0
+#, python-format
+msgid "Multiple overlapping periods for date %(date)s and company %(company_name)s"
+msgstr ""
+
#. module: account_banking
#: code:addons/account_banking/wizard/bank_import.py:0
#, python-format
@@ -439,12 +420,24 @@ msgstr ""
msgid "Error"
msgstr ""
+#. module: account_banking
+#: code:addons/account_banking/wizard/bank_import.py:0
+#, python-format
+msgid "Total number of statements"
+msgstr ""
+
#. module: account_banking
#: code:addons/account_banking/account_banking.py:0
#, python-format
msgid "Unable to reconcile entry \"%s\": %.2f"
msgstr ""
+#. module: account_banking
+#: code:addons/account_banking/wizard/banktools.py:0
+#, python-format
+msgid "No suitable fiscal year found for date %(date)s and company %(company_name)s"
+msgstr ""
+
#. module: account_banking
#: view:account.banking.imported.file:0
msgid "Import Details"
@@ -498,9 +491,14 @@ msgid "Account Banking"
msgstr ""
#. module: account_banking
-#: code:addons/account_banking/wizard/bank_import.py:0
+#: wizard_button:account_banking.banking_import,view_error,open_import:0
+msgid "_View Imported File"
+msgstr ""
+
+#. module: account_banking
+#: code:addons/account_banking/account_banking.py:0
#, python-format
-msgid "Total number of statements"
+msgid "The IBAN number doesn't seem to be correct"
msgstr ""
#. module: account_banking
@@ -509,6 +507,12 @@ msgstr ""
msgid "File Format"
msgstr ""
+#. module: account_banking
+#: code:addons/account_banking/wizard/banktools.py:0
+#, python-format
+msgid "Multiple overlapping fiscal years found for date %(date)s and company %(company_name)s"
+msgstr ""
+
#. module: account_banking
#: field:account.banking.account.settings,journal_id:0
msgid "Journal"
@@ -519,24 +523,11 @@ msgstr ""
msgid "Finished"
msgstr ""
-#. module: account_banking
-#: code:addons/account_banking/wizard/banktools.py:0
-#, python-format
-msgid "No suitable fiscal year found for company %(company_name)s"
-msgstr ""
-
#. module: account_banking
#: view:account.banking.account.settings:0
msgid "Bank Account Details"
msgstr ""
-#. module: account_banking
-#: code:addons/account_banking/wizard/bank_import.py:0
-#, python-format
-msgid "Unable to link transaction %(trans)s to invoice: '\n"
-" '%(no_candidates)s candidates found; can\'t choose."
-msgstr ""
-
#. module: account_banking
#: field:account.bank.statement.line,partner_bank_id:0
#: field:account.banking.account.settings,partner_bank_id:0
@@ -550,9 +541,72 @@ msgid "Number of transactions loaded"
msgstr ""
#. module: account_banking
-#: code:addons/account_banking/wizard/banktools.py:0
-#, python-format
-msgid "Multiple overlapping fiscal years found for date %(date)s"
+#: model:ir.module.module,description:account_banking.module_meta_information
+msgid "\n"
+" Module to do banking.\n"
+"\n"
+" Note: This module is depending on BeautifulSoup.\n"
+"\n"
+" This modules tries to combine all current banking import and export\n"
+" schemes. Rationale for this is that it is quite common to have foreign\n"
+" bank account numbers next to national bank account numbers. The current\n"
+" approach, which hides the national banking interface schemes in the\n"
+" l10n_xxx modules, makes it very difficult to use these simultanious.\n"
+" A more banking oriented approach seems more logical and cleaner.\n"
+"\n"
+" Changes to default OpenERP:\n"
+"\n"
+" * Puts focus on the real life messaging with banks:\n"
+" + Bank statement lines upgraded to independent bank transactions.\n"
+" + Banking statements have no special accountancy meaning, they're just\n"
+" message envelopes for a number of bank transactions.\n"
+" + Bank statements can be either encoded by hand to reflect the document\n"
+" version of Bank Statements, or created as an optional side effect of\n"
+" importing Bank Transactions.\n"
+"\n"
+" * Preparations for SEPA:\n"
+" + IBAN accounts are the standard in the SEPA countries\n"
+" + local accounts are derived from SEPA (excluding Turkey) but are\n"
+" considered to be identical to the corresponding SEPA account.\n"
+" + Banks are identified with either Country + Bank code + Branch code or BIC\n"
+" + Each bank can have its own pace in introducing SEPA into their\n"
+" communication with their customers.\n"
+" + National online databases can be used to convert BBAN's to IBAN's.\n"
+" + The SWIFT database is consulted for bank information.\n"
+"\n"
+" * Adds dropin extensible import facility for bank communication in:\n"
+" - Drop-in input parser development.\n"
+" - MultiBank (NL) format transaction files available as\n"
+" account_banking_nl_multibank,\n"
+" - (todo) MT940 (Swift) format transaction files,\n"
+" - (todo) CODA (BE) format transaction files,\n"
+" - (wish) SEPA Credits (ISO 200022) messages,\n"
+"\n"
+" * Extends payments for digital banking:\n"
+" + Adapted workflow in payments to reflect banking operations\n"
+" + Relies on account_payment mechanics to extend with export generators.\n"
+" - ClieOp3 (NL) payment and direct debit orders files available as\n"
+" account_banking_nl_clieop\n"
+" - (wish) BTL91 (NL) payment orders files (no format description available),\n"
+" - (wish) SEPA Direct Debits (ISO 200022) messages\n"
+"\n"
+" * Additional features for the import/export mechanism:\n"
+" + Automatic matching and creation of bank accounts, banks and partners,\n"
+" during import of statements.\n"
+" + Automatic matching with invoices and payments.\n"
+" + Sound import mechanism, allowing multiple imports of the same\n"
+" transactions repeated over multiple files.\n"
+" + Journal configuration per bank account.\n"
+" + Business logic and format parsing strictly separated to ease the\n"
+" development of new parsers.\n"
+" + No special configuration needed for the parsers, new parsers are\n"
+" recognized and made available at server (re)start.\n"
+" "
+msgstr ""
+
+#. module: account_banking
+#: model:res.partner.bank.type.field,name:account_banking.bank_acc_number_field
+msgid "acc_number"
msgstr ""
#. module: account_banking
diff --git a/account_banking/i18n/en_US.po b/account_banking/i18n/en_US.po
index 0903ead00..a2b44866b 100644
--- a/account_banking/i18n/en_US.po
+++ b/account_banking/i18n/en_US.po
@@ -6,8 +6,8 @@ msgid ""
msgstr ""
"Project-Id-Version: OpenERP Server 5.0.7\n"
"Report-Msgid-Bugs-To: support@openerp.com\n"
-"POT-Creation-Date: 2010-01-08 15:30:50+0000\n"
-"PO-Revision-Date: 2010-01-08 15:30:50+0000\n"
+"POT-Creation-Date: 2010-02-19 16:17:51+0000\n"
+"PO-Revision-Date: 2010-02-19 16:17:51+0000\n"
"Last-Translator: <>\n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
@@ -16,7 +16,8 @@ msgstr ""
"Plural-Forms: \n"
#. module: account_banking
-#: wizard_view:account_banking.banking_import,import:0
+#: wizard_view:account_banking.banking_import,view_error:0
+#: wizard_view:account_banking.banking_import,view_statements:0
msgid "Results:"
msgstr ""
@@ -36,18 +37,19 @@ msgstr ""
msgid "Invalid model name in the action definition."
msgstr ""
-#. module: account_banking
-#: wizard_button:account_banking.banking_import,import,open:0
-msgid "_Open Statement"
-msgstr ""
-
#. module: account_banking
#: field:payment.line,date_done:0
msgid "Date Confirmed"
msgstr ""
#. module: account_banking
-#: wizard_button:account_banking.banking_import,import,end:0
+#: wizard_button:account_banking.banking_import,view_statements,open_statements:0
+msgid "_View Statements"
+msgstr ""
+
+#. module: account_banking
+#: wizard_button:account_banking.banking_import,view_error,end:0
+#: wizard_button:account_banking.banking_import,view_statements,end:0
msgid "_Close"
msgstr ""
@@ -106,14 +108,13 @@ msgstr ""
#. module: account_banking
#: code:addons/account_banking/wizard/bank_import.py:0
#, python-format
-msgid "Statement for account %(bank_account)s uses different '\n"
-" 'currency than the defined bank journal."
+msgid "Number of statements skipped due to errors"
msgstr ""
#. module: account_banking
-#: code:addons/account_banking/wizard/bank_import.py:0
+#: code:addons/account_banking/account_banking.py:0
#, python-format
-msgid "Number of statements skipped due to errors"
+msgid "Invalid IBAN account number!"
msgstr ""
#. module: account_banking
@@ -148,6 +149,12 @@ msgstr ""
msgid "Default debit account"
msgstr ""
+#. module: account_banking
+#: code:addons/account_banking/wizard/banktools.py:0
+#, python-format
+msgid "Unknown Bank"
+msgstr ""
+
#. module: account_banking
#: wizard_button:account_banking.banking_import,init,end:0
msgid "_Cancel"
@@ -168,6 +175,12 @@ msgstr ""
msgid "Confirmed"
msgstr ""
+#. module: account_banking
+#: model:ir.actions.act_window,name:account_banking.action_account_banking_res_partner_banks
+#: model:ir.ui.menu,name:account_banking.menu_action_account_banking_bank_accounts
+msgid "Bank Accounts"
+msgstr ""
+
#. module: account_banking
#: view:account.banking.account.settings:0
msgid "Default Accounts for Unknown Movements"
@@ -178,16 +191,16 @@ msgstr ""
msgid "Confirm"
msgstr ""
-#. module: account_banking
-#: field:account.banking.account.settings,default_credit_account_id:0
-msgid "Default credit account"
-msgstr ""
-
#. module: account_banking
#: code:addons/account_banking/wizard/bank_import.py:0
#, python-format
msgid "Statements found for account %(bank_account)s, '\n"
-" 'but no default journal was defined."
+" 'but no default journal was defined."
+msgstr ""
+
+#. module: account_banking
+#: field:account.banking.account.settings,default_credit_account_id:0
+msgid "Default credit account"
msgstr ""
#. module: account_banking
@@ -206,6 +219,13 @@ msgstr ""
msgid "Bank Transaction ID"
msgstr ""
+#. module: account_banking
+#: code:addons/account_banking/wizard/bank_import.py:0
+#, python-format
+msgid "Unable to link transaction %(trans)s to invoice: '\n"
+" '%(no_candidates)s candidates found; can\'t choose."
+msgstr ""
+
#. module: account_banking
#: code:addons/account_banking/wizard/bank_import.py:0
#, python-format
@@ -248,6 +268,18 @@ msgid "The Transactions File to import. Please note that while it is perfectly s
"To stay on the safe side, always load bank statements files using the same format."
msgstr ""
+#. module: account_banking
+#: field:account.banking.imported.file,state:0
+#: field:payment.line,export_state:0
+msgid "State"
+msgstr ""
+
+#. module: account_banking
+#: code:addons/account_banking/sepa/bbantoiban.py:0
+#, python-format
+msgid "This is a stub. Please implement your own code"
+msgstr ""
+
#. module: account_banking
#: constraint:ir.ui.view:0
msgid "Invalid XML for View Architecture!"
@@ -259,8 +291,9 @@ msgid "Imported Bank Statements"
msgstr ""
#. module: account_banking
-#: wizard_view:account_banking.banking_import,import:0
#: wizard_view:account_banking.banking_import,init:0
+#: wizard_view:account_banking.banking_import,view_error:0
+#: wizard_view:account_banking.banking_import,view_statements:0
msgid "Import Bank Transactions File"
msgstr ""
@@ -282,9 +315,10 @@ msgid "More then one possible match found for partner with name %(name)s"
msgstr ""
#. module: account_banking
-#: field:account.banking.imported.file,state:0
-#: field:payment.line,export_state:0
-msgid "State"
+#: code:addons/account_banking/wizard/bank_import.py:0
+#, python-format
+msgid "Statement for account %(bank_account)s uses different '\n"
+" 'currency than the defined bank journal."
msgstr ""
#. module: account_banking
@@ -294,15 +328,8 @@ msgid "ERROR!"
msgstr ""
#. module: account_banking
-#: code:addons/account_banking/wizard/banktools.py:0
-#, python-format
-msgid "No suitable period found for date %(date)s"
-msgstr ""
-
-#. module: account_banking
-#: code:addons/account_banking/wizard/banktools.py:0
-#, python-format
-msgid "Multiple overlapping periods for date %(date)s"
+#: field:account.bank.statement.line,currency:0
+msgid "Currency"
msgstr ""
#. module: account_banking
@@ -313,7 +340,8 @@ msgid "Company"
msgstr ""
#. module: account_banking
-#: wizard_field:account_banking.banking_import,import,log:0
+#: wizard_field:account_banking.banking_import,view_error,log:0
+#: wizard_field:account_banking.banking_import,view_statements,log:0
msgid "Log"
msgstr ""
@@ -328,65 +356,6 @@ msgstr ""
msgid "Configration Error !"
msgstr ""
-#. module: account_banking
-#: model:ir.module.module,description:account_banking.module_meta_information
-msgid "\n"
-" Module to do banking.\n"
-"\n"
-" This modules tries to combine all current banking import and export\n"
-" schemes. Rationale for this is that it is quite common to have foreign\n"
-" bank account numbers next to national bank account numbers. The current\n"
-" approach, which hides the national banking interface schemes in the\n"
-" l10n_xxx modules, makes it very difficult to use these simultanious.\n"
-" A more banking oriented approach seems more logical and cleaner.\n"
-"\n"
-" Changes to default OpenERP:\n"
-"\n"
-" * Puts focus on the real life messaging with banks:\n"
-" + Bank statement lines upgraded to independent bank transactions.\n"
-" + Banking statements have no special accountancy meaning, they're just\n"
-" message envelopes for a number of bank transactions.\n"
-" + Bank statements can be either encoded by hand to reflect the document\n"
-" version of Bank Statements, or created as an optional side effect of\n"
-" importing Bank Transactions.\n"
-"\n"
-" * Preparations for SEPA:\n"
-" + IBAN accounts are the standard in the SEPA countries\n"
-" + local accounts are derived from SEPA (excluding Turkey) but are\n"
-" considered to be identical to the corresponding SEPA account.\n"
-" + Banks are identified with either Country + Bank code + Branch code or BIC\n"
-" + Each bank can have its own pace in introducing SEPA into their\n"
-" communication with their customers.\n"
-" + National online databases can be used to convert BBAN's to IBAN's.\n"
-"\n"
-" * Adds dropin extensible import facility for bank communication in:\n"
-" + MultiBank (NL) format transaction files,\n"
-" - (todo) MT940 (Swift) format transaction files,\n"
-" - (todo) CODA (BE) format transaction files,\n"
-" - (wish) SEPA Credits (ISO 200022) messages,\n"
-"\n"
-" * Extends payments for digital banking:\n"
-" + Adapted workflow in payments to reflect banking operations\n"
-" + Relies on account_payment mechanics to extend with export generators.\n"
-" - ClieOp3 (NL) payment and direct debit orders files available as\n"
-" account_banking_nl_clieop\n"
-" - (wish) BTL91 (NL) payment orders files (no format description available),\n"
-" - (wish) SEPA Direct Debits (ISO 200022) messages\n"
-"\n"
-" * Additional features for the import/export mechanism:\n"
-" + Automatic matching and creation of bank accounts, banks and partners,\n"
-" during import of statements.\n"
-" + Automatic matching with invoices and payments.\n"
-" + Sound import mechanism, allowing multiple imports of the same\n"
-" transactions repeated over multiple files.\n"
-" + Journal configuration per bank account.\n"
-" + Business logic and format parsing strictly separated to ease the\n"
-" development of new parsers.\n"
-" + No special configuration needed for the parsers, new parsers are\n"
-" recognized and made available at server (re)start.\n"
-" "
-msgstr ""
-
#. module: account_banking
#: model:ir.actions.act_window,name:account_banking.act_account_payment_account_bank_statement
msgid "Bank Statements File"
@@ -398,6 +367,12 @@ msgstr ""
msgid "This is a stub. Please implement your own."
msgstr ""
+#. module: account_banking
+#: code:addons/account_banking/wizard/banktools.py:0
+#, python-format
+msgid "No suitable period found for date %(date)s and company %(company_name)s"
+msgstr ""
+
#. module: account_banking
#: view:account.banking.imported.file:0
#: model:ir.actions.act_window,name:account_banking.action_account_banking_imported_files
@@ -416,6 +391,12 @@ msgstr ""
msgid "Import Log"
msgstr ""
+#. module: account_banking
+#: code:addons/account_banking/wizard/banktools.py:0
+#, python-format
+msgid "Multiple overlapping periods for date %(date)s and company %(company_name)s"
+msgstr ""
+
#. module: account_banking
#: code:addons/account_banking/wizard/bank_import.py:0
#, python-format
@@ -439,12 +420,24 @@ msgstr ""
msgid "Error"
msgstr ""
+#. module: account_banking
+#: code:addons/account_banking/wizard/bank_import.py:0
+#, python-format
+msgid "Total number of statements"
+msgstr ""
+
#. module: account_banking
#: code:addons/account_banking/account_banking.py:0
#, python-format
msgid "Unable to reconcile entry \"%s\": %.2f"
msgstr ""
+#. module: account_banking
+#: code:addons/account_banking/wizard/banktools.py:0
+#, python-format
+msgid "No suitable fiscal year found for date %(date)s and company %(company_name)s"
+msgstr ""
+
#. module: account_banking
#: view:account.banking.imported.file:0
msgid "Import Details"
@@ -498,9 +491,14 @@ msgid "Account Banking"
msgstr ""
#. module: account_banking
-#: code:addons/account_banking/wizard/bank_import.py:0
+#: wizard_button:account_banking.banking_import,view_error,open_import:0
+msgid "_View Imported File"
+msgstr ""
+
+#. module: account_banking
+#: code:addons/account_banking/account_banking.py:0
#, python-format
-msgid "Total number of statements"
+msgid "The IBAN number doesn't seem to be correct"
msgstr ""
#. module: account_banking
@@ -509,6 +507,12 @@ msgstr ""
msgid "File Format"
msgstr ""
+#. module: account_banking
+#: code:addons/account_banking/wizard/banktools.py:0
+#, python-format
+msgid "Multiple overlapping fiscal years found for date %(date)s and company %(company_name)s"
+msgstr ""
+
#. module: account_banking
#: field:account.banking.account.settings,journal_id:0
msgid "Journal"
@@ -519,24 +523,11 @@ msgstr ""
msgid "Finished"
msgstr ""
-#. module: account_banking
-#: code:addons/account_banking/wizard/banktools.py:0
-#, python-format
-msgid "No suitable fiscal year found for company %(company_name)s"
-msgstr ""
-
#. module: account_banking
#: view:account.banking.account.settings:0
msgid "Bank Account Details"
msgstr ""
-#. module: account_banking
-#: code:addons/account_banking/wizard/bank_import.py:0
-#, python-format
-msgid "Unable to link transaction %(trans)s to invoice: '\n"
-" '%(no_candidates)s candidates found; can\'t choose."
-msgstr ""
-
#. module: account_banking
#: field:account.bank.statement.line,partner_bank_id:0
#: field:account.banking.account.settings,partner_bank_id:0
@@ -550,9 +541,72 @@ msgid "Number of transactions loaded"
msgstr ""
#. module: account_banking
-#: code:addons/account_banking/wizard/banktools.py:0
-#, python-format
-msgid "Multiple overlapping fiscal years found for date %(date)s"
+#: model:ir.module.module,description:account_banking.module_meta_information
+msgid "\n"
+" Module to do banking.\n"
+"\n"
+" Note: This module is depending on BeautifulSoup.\n"
+"\n"
+" This modules tries to combine all current banking import and export\n"
+" schemes. Rationale for this is that it is quite common to have foreign\n"
+" bank account numbers next to national bank account numbers. The current\n"
+" approach, which hides the national banking interface schemes in the\n"
+" l10n_xxx modules, makes it very difficult to use these simultanious.\n"
+" A more banking oriented approach seems more logical and cleaner.\n"
+"\n"
+" Changes to default OpenERP:\n"
+"\n"
+" * Puts focus on the real life messaging with banks:\n"
+" + Bank statement lines upgraded to independent bank transactions.\n"
+" + Banking statements have no special accountancy meaning, they're just\n"
+" message envelopes for a number of bank transactions.\n"
+" + Bank statements can be either encoded by hand to reflect the document\n"
+" version of Bank Statements, or created as an optional side effect of\n"
+" importing Bank Transactions.\n"
+"\n"
+" * Preparations for SEPA:\n"
+" + IBAN accounts are the standard in the SEPA countries\n"
+" + local accounts are derived from SEPA (excluding Turkey) but are\n"
+" considered to be identical to the corresponding SEPA account.\n"
+" + Banks are identified with either Country + Bank code + Branch code or BIC\n"
+" + Each bank can have its own pace in introducing SEPA into their\n"
+" communication with their customers.\n"
+" + National online databases can be used to convert BBAN's to IBAN's.\n"
+" + The SWIFT database is consulted for bank information.\n"
+"\n"
+" * Adds dropin extensible import facility for bank communication in:\n"
+" - Drop-in input parser development.\n"
+" - MultiBank (NL) format transaction files available as\n"
+" account_banking_nl_multibank,\n"
+" - (todo) MT940 (Swift) format transaction files,\n"
+" - (todo) CODA (BE) format transaction files,\n"
+" - (wish) SEPA Credits (ISO 200022) messages,\n"
+"\n"
+" * Extends payments for digital banking:\n"
+" + Adapted workflow in payments to reflect banking operations\n"
+" + Relies on account_payment mechanics to extend with export generators.\n"
+" - ClieOp3 (NL) payment and direct debit orders files available as\n"
+" account_banking_nl_clieop\n"
+" - (wish) BTL91 (NL) payment orders files (no format description available),\n"
+" - (wish) SEPA Direct Debits (ISO 200022) messages\n"
+"\n"
+" * Additional features for the import/export mechanism:\n"
+" + Automatic matching and creation of bank accounts, banks and partners,\n"
+" during import of statements.\n"
+" + Automatic matching with invoices and payments.\n"
+" + Sound import mechanism, allowing multiple imports of the same\n"
+" transactions repeated over multiple files.\n"
+" + Journal configuration per bank account.\n"
+" + Business logic and format parsing strictly separated to ease the\n"
+" development of new parsers.\n"
+" + No special configuration needed for the parsers, new parsers are\n"
+" recognized and made available at server (re)start.\n"
+" "
+msgstr ""
+
+#. module: account_banking
+#: model:res.partner.bank.type.field,name:account_banking.bank_acc_number_field
+msgid "acc_number"
msgstr ""
#. module: account_banking
diff --git a/account_banking/i18n/nl_NL.po b/account_banking/i18n/nl_NL.po
index fa91213a7..0e3c5e672 100644
--- a/account_banking/i18n/nl_NL.po
+++ b/account_banking/i18n/nl_NL.po
@@ -578,7 +578,7 @@ msgstr "Details bankrekening"
#: code:addons/account_banking/wizard/bank_import.py:0
#, python-format
msgid "Unable to link transaction %(trans)s to invoice: '\n"
-" '%(no_candidates)s candidates found; can\'t choose."
+" '%(no_candidates)s candidates found; can't choose."
msgstr "Niet in staat transactie %(trans)s aan factuur te koppelen: '\n"
" '%(no_candidates)s kandidaten gevonden; kan niet kiezen."
diff --git a/account_banking/sepa/online.py b/account_banking/sepa/online.py
index e0da7665c..831ade094 100644
--- a/account_banking/sepa/online.py
+++ b/account_banking/sepa/online.py
@@ -35,6 +35,7 @@ __all__ = [
]
IBANlink_NL = 'http://www.ibannl.org/iban_check.php'
+IBANlink_BE = 'http://www.ibanbic.be/Default.aspx'
def get_iban_bic_NL(bank_acc):
'''
@@ -63,8 +64,47 @@ def get_iban_bic_NL(bank_acc):
return result
return None
+def get_iban_bic_BE(bank_acc):
+ '''
+ Consult the Belgian online database to check both account number and the
+ bank it belongs to. Will not work offline, is limited to banks operating
+ in Belgium and will only convert Belgian local account numbers.
+ '''
+ def contents(soup, attr):
+ return soup.find('input', {'id': 'textbox%s' % attr}).contents[0].strip()
+
+ if not bank_acc.strip():
+ return None
+
+ # Get empty form with hidden validators
+ agent = URLAgent()
+ request = agent.open(IBANlink_BE)
+
+ # Isolate form and fill it in
+ soup = BeautifulSoup(request)
+ form = SoupForm(soup.find('form', {'id': 'form1'}))
+ form['textboxBBAN'] = bank_acc.strip()
+ form['Convert'] = 'Convert Number'
+
+ # Submit the form
+ response = agent.submit(form)
+
+ # Parse the results
+ soup = BeautifulSoup(response)
+ result = struct()
+ result.iban = contents(soup, 'IBAN')
+ result.bic = contents(soup, 'BIC').replace(' ', '')
+ result.bank = contents(soup, 'BankName')
+
+ # Add substracts
+ result.account = bank_acc
+ result.country_id = result.bic[4:6]
+ result.code = result.bic[:6]
+ return result
+
_account_info = {
# TODO: Add more online data banks
+ #'BE': get_iban_bic_BE,
'NL': get_iban_bic_NL,
}
diff --git a/account_banking/wizard/banktools.py b/account_banking/wizard/banktools.py
index c7e30a0eb..cee2cc2fa 100644
--- a/account_banking/wizard/banktools.py
+++ b/account_banking/wizard/banktools.py
@@ -184,12 +184,16 @@ def get_company_bank_account(pool, cursor, uid, account_number, currency,
results.default_credit_account_id = settings.default_credit_account_id
return results
-def get_or_create_bank(pool, cursor, uid, bic, online=True):
+def get_or_create_bank(pool, cursor, uid, bic, online=False, code=None,
+ name=None):
'''
Find or create the bank with the provided BIC code.
When online, the SWIFT database will be consulted in order to
provide for missing information.
'''
+ # UPDATE: Free SWIFT databases are since 2/22/2010 hidden behind an
+ # image challenge/response interface.
+
bank_obj = pool.get('res.bank')
# Self generated key?
@@ -233,12 +237,14 @@ def get_or_create_bank(pool, cursor, uid, bic, online=True):
))
else:
bank_id = False
+ else:
+ info = struct(name=name, code=code)
country_id = country_ids and country_ids[0] or False
- if not online or not bank_id:
+ if info.code and ((not online) or not bank_id):
bank_id = bank_obj.create(cursor, uid, dict(
code = info.code,
- name = _('Unknown Bank'),
+ name = info.name or _('Unknown Bank'),
country = country_id,
bic = bic,
))
diff --git a/account_banking_nl_clieop/wizard/export_clieop.py b/account_banking_nl_clieop/wizard/export_clieop.py
index 21eb38c1c..23c378962 100644
--- a/account_banking_nl_clieop/wizard/export_clieop.py
+++ b/account_banking_nl_clieop/wizard/export_clieop.py
@@ -254,7 +254,8 @@ def _create_clieop(self, cursor, uid, data, context):
for payment_order in payment_orders:
if not clieopfile:
# Just once: create clieop file
- our_account_owner = payment_order.mode.bank_id.owner_name
+ our_account_owner = payment_order.mode.bank_id.owner_name \
+ or payment_order.mode.bank_id.partner_id.name
our_account_nr = payment_order.mode.bank_id.acc_number
if not our_account_nr and payment_order.mode.bank_id.iban:
our_account_nr = sepa.IBAN(
@@ -289,7 +290,7 @@ def _create_clieop(self, cursor, uid, data, context):
for line in payment_order.line_ids:
kwargs = dict(
- name = line.bank_id.owner_name,
+ name = line.bank_id.owner_name or line.bank_id.partner_id.name,
amount = line.amount_currency,
reference = line.communication or None,
)