diff --git a/bt5/erp5_banking_core/SkinTemplateItem/portal_skins/erp5_banking_core/Baobab_getAccountForSite.xml b/bt5/erp5_banking_core/SkinTemplateItem/portal_skins/erp5_banking_core/Baobab_getAccountForSite.xml index 36155781fb0d92fc4be6ede661795e563d94f3ad..2f47ada89ddf3aa73a61dd786ded15d06e3cc599 100644 --- a/bt5/erp5_banking_core/SkinTemplateItem/portal_skins/erp5_banking_core/Baobab_getAccountForSite.xml +++ b/bt5/erp5_banking_core/SkinTemplateItem/portal_skins/erp5_banking_core/Baobab_getAccountForSite.xml @@ -71,9 +71,17 @@ orga_id = "site_%3s" %(site.getCodification())\n organisation = context.organisation_module[orga_id]\n \n account_list = [x for x in organisation.objectValues(portal_type=\'Bank Account\') if x.getValidationState() == \'valid\']\n -if len(account_list)!=1:\n +if len(account_list)==0:\n raise ValueError, \'Must not get %d account for the organisation %s\' %(len(account_list),organisation.getTitle())\n -return account_list[0]\n +for acc in account_list:\n + acc = acc.getObject()\n + if acc.getBicCode() is not None:\n + return acc\n +\n +\n +raise ValueError, "No account with bic code found"\n +\n +#return account_list[0]\n </string> </value> </item> <item> @@ -137,6 +145,8 @@ return account_list[0]\n <string>account_list</string> <string>len</string> <string>ValueError</string> + <string>acc</string> + <string>None</string> </tuple> </value> </item> diff --git a/bt5/erp5_banking_core/bt/revision b/bt5/erp5_banking_core/bt/revision index 1fde7522a771ec6f5d8c6237abe49bac75f547c8..5a40cf687a21409d830ec15ba6da1182e125b9f9 100644 --- a/bt5/erp5_banking_core/bt/revision +++ b/bt5/erp5_banking_core/bt/revision @@ -1 +1 @@ -434 \ No newline at end of file +435 \ No newline at end of file