Commit 76da968c authored by Vincent Pelletier's avatar Vincent Pelletier

Coins don't have the same constraints on destination that banknotes have.

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@28757 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 2fe55ac7
...@@ -70,11 +70,29 @@ destination = context.getDestinationSection()\n ...@@ -70,11 +70,29 @@ destination = context.getDestinationSection()\n
context.log(source, destination)\n context.log(source, destination)\n
if source is None or destination is None:\n if source is None or destination is None:\n
return None\n return None\n
if source.split("/")[-1] == destination.split("/")[-1] or "transit" not in source:\n \n
has_banknote = 0\n
has_coin = 0\n
\n
for movement in context.getMovementList():\n
resource_portal_type = movement.getResourceValue().getPortalType()\n
if resource_portal_type == \'Coin\':\n
has_coin = 1\n
break\n
elif resource_portal_type == \'Banknote\':\n
has_banknote = 1\n
break\n
\n
if has_banknote == 1:\n
if source.split("/")[-1] == destination.split("/")[-1] or "transit" not in source:\n
destination = "%s/caveau/serre/encaisse_des_billets_neufs_non_emis" % destination\n destination = "%s/caveau/serre/encaisse_des_billets_neufs_non_emis" % destination\n
else:\n else:\n
destination = "%s/caveau/serre/encaisse_des_billets_neufs_non_emis_en_transit_allant_a/%s" % (destination, source.split("/")[-1])\n destination = "%s/caveau/serre/encaisse_des_billets_neufs_non_emis_en_transit_allant_a/%s" % (destination, source.split("/")[-1])\n
\n elif has_coin == 1:\n
destination = "%s/caveau/serre/encaisse_des_billets_neufs_non_emis" % destination\n
else:\n
destination = None\n
\n
return destination\n return destination\n
</string> </value> </string> </value>
</item> </item>
...@@ -100,6 +118,14 @@ return destination\n ...@@ -100,6 +118,14 @@ return destination\n
<key> <string>_params</string> </key> <key> <string>_params</string> </key>
<value> <string>*args, **kw</string> </value> <value> <string>*args, **kw</string> </value>
</item> </item>
<item>
<key> <string>_proxy_roles</string> </key>
<value>
<tuple>
<string>Manager</string>
</tuple>
</value>
</item>
<item> <item>
<key> <string>errors</string> </key> <key> <string>errors</string> </key>
<value> <value>
...@@ -131,6 +157,11 @@ return destination\n ...@@ -131,6 +157,11 @@ return destination\n
<string>source</string> <string>source</string>
<string>destination</string> <string>destination</string>
<string>None</string> <string>None</string>
<string>has_banknote</string>
<string>has_coin</string>
<string>_getiter_</string>
<string>movement</string>
<string>resource_portal_type</string>
<string>_getitem_</string> <string>_getitem_</string>
</tuple> </tuple>
</value> </value>
......
670 672
\ 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