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
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>
......
434
\ No newline at end of file
435
\ 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