Commit 2488d99a authored by Aurel's avatar Aurel

raise error if not currency found for vault

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@13778 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 728fe3ae
......@@ -74,11 +74,16 @@ currency_id = None\n
# a mapping or something instead\n
if \'encaisse_des_devises\' in vault_list:\n
vault_currency_title = vault_list[vault_list.index(\'encaisse_des_devises\')+1]\n
context.log(\'Baobab_getVaultCurrency, vault = \', vault_currency_title)\n
for currency in context.currency_module.objectValues():\n
context.log(\'Baobab_getVaultCurrency, cur = \', currency.getTitle())\n
currency_title = currency.getTitle().replace(\' \',\'_\').lower()\n
if currency_title == vault_currency_title:\n
return currency.getRelativeUrl()\n
return context.currency_module[context.Baobab_getPortalReferenceCurrencyID()].getRelativeUrl()\n
else:\n
return context.currency_module[context.Baobab_getPortalReferenceCurrencyID()].getRelativeUrl()\n
\n
raise ValueError, \'No currency found for vault %s\' %vault\n
</string> </value>
</item>
<item>
......@@ -135,10 +140,11 @@ return context.currency_module[context.Baobab_getPortalReferenceCurrencyID()].ge
<string>currency_id</string>
<string>_getitem_</string>
<string>vault_currency_title</string>
<string>_getiter_</string>
<string>context</string>
<string>_getiter_</string>
<string>currency</string>
<string>currency_title</string>
<string>ValueError</string>
</tuple>
</value>
</item>
......
177
\ No newline at end of file
179
\ 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