Commit 90829f59 authored by Aurel's avatar Aurel

return a bank account only of bic code is defined

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@20772 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 91d5181c
...@@ -71,9 +71,17 @@ orga_id = "site_%3s" %(site.getCodification())\n ...@@ -71,9 +71,17 @@ orga_id = "site_%3s" %(site.getCodification())\n
organisation = context.organisation_module[orga_id]\n organisation = context.organisation_module[orga_id]\n
\n \n
account_list = [x for x in organisation.objectValues(portal_type=\'Bank Account\') if x.getValidationState() == \'valid\']\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 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> </string> </value>
</item> </item>
<item> <item>
...@@ -137,6 +145,8 @@ return account_list[0]\n ...@@ -137,6 +145,8 @@ return account_list[0]\n
<string>account_list</string> <string>account_list</string>
<string>len</string> <string>len</string>
<string>ValueError</string> <string>ValueError</string>
<string>acc</string>
<string>None</string>
</tuple> </tuple>
</value> </value>
</item> </item>
......
434 435
\ No newline at end of file \ No newline at end of file
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment