Commit ba7bd437 authored by Aurel's avatar Aurel

do not compute source/destination if currency is None

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@15101 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 161ddc5d
...@@ -71,10 +71,12 @@ if source_trade is None:\n ...@@ -71,10 +71,12 @@ if source_trade is None:\n
document = context.getParentValue()\n document = context.getParentValue()\n
default_currency = "currency_module/%s" %context.Baobab_getPortalReferenceCurrencyID()\n default_currency = "currency_module/%s" %context.Baobab_getPortalReferenceCurrencyID()\n
currency = document.getResource()\n currency = document.getResource()\n
if currency is None:\n
return None\n
if currency == default_currency:\n if currency == default_currency:\n
vault = \'/encaisse_des_billets_et_monnaies/entrante\'\n vault = \'/encaisse_des_billets_et_monnaies/entrante\'\n
else:\n else:\n
vault_title = (document.getResourceTitle().lower()).replace(\' \', \'_\')\n vault_title = (document.getResourceTitle(\'\').lower()).replace(\' \', \'_\')\n
vault = \'/encaisse_des_devises/%s/sortante\' %(vault_title,)\n vault = \'/encaisse_des_devises/%s/sortante\' %(vault_title,)\n
# add it to user defined counter\n # add it to user defined counter\n
user_id = document.Base_getLastUserIdByTransition(workflow_id=\'incident_workflow\', transition_id=\'deliver_action\')\n user_id = document.Base_getLastUserIdByTransition(workflow_id=\'incident_workflow\', transition_id=\'deliver_action\')\n
......
...@@ -71,10 +71,12 @@ if source_trade is None:\n ...@@ -71,10 +71,12 @@ if source_trade is None:\n
document = context.getParentValue()\n document = context.getParentValue()\n
default_currency = "currency_module/%s" %context.Baobab_getPortalReferenceCurrencyID()\n default_currency = "currency_module/%s" %context.Baobab_getPortalReferenceCurrencyID()\n
currency = document.getResource()\n currency = document.getResource()\n
if currency is None:\n
return None\n
if currency == default_currency:\n if currency == default_currency:\n
vault = \'/encaisse_des_billets_et_monnaies/sortante\'\n vault = \'/encaisse_des_billets_et_monnaies/sortante\'\n
else:\n else:\n
vault_title = (document.getResourceTitle().lower()).replace(\' \', \'_\')\n vault_title = (document.getResourceTitle(\'\').lower()).replace(\' \', \'_\')\n
vault = \'/encaisse_des_devises/%s/sortante\' %(vault_title,)\n vault = \'/encaisse_des_devises/%s/sortante\' %(vault_title,)\n
# add it to user defined counter\n # add it to user defined counter\n
user_id = document.Base_getLastUserIdByTransition(workflow_id=\'incident_workflow\', transition_id=\'deliver_action\')\n user_id = document.Base_getLastUserIdByTransition(workflow_id=\'incident_workflow\', transition_id=\'deliver_action\')\n
......
381 385
\ 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