Commit 1cef582e authored by Vincent Pelletier's avatar Vincent Pelletier

Use getSourceTrade to determine document's site.

Exchanged Mutilated Banknote must not be in headquater's stock, only in agency's, and only in 2 workflow states.

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@15359 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 42e63b32
...@@ -65,19 +65,11 @@ ...@@ -65,19 +65,11 @@
</item> </item>
<item> <item>
<key> <string>_body</string> </key> <key> <string>_body</string> </key>
<value> <string>destination = "%s/surface/caisse_courante/encaisse_des_billets_et_monnaies" %(context.getSourceTrade(),)\n <value> <string>mutilated_banknote = context.getParentValue()\n
\n mutilated_banknote_source_trade = mutilated_banknote.getSourceTrade(\'\')\n
# If it was sent to headquarters, the destination\n if \'siege\' not in mutilated_banknote_source_trade and mutilated_banknote.getWorkflowState() in (\'finished\', \'delivered\'):\n
# must be None\n return "%s/surface/caisse_courante/encaisse_des_billets_et_monnaies" % (mutilated_banknote_source_trade, )\n
parent = context.getParentValue()\n return None\n
for workflow_item in \\\n
parent.Base_getWorkflowHistoryItemList(\'mutilated_banknote_workflow\',\n
display=0):\n
if workflow_item.state == \'planned\':\n
destination = None\n
break\n
\n
return destination\n
</string> </value> </string> </value>
</item> </item>
<item> <item>
...@@ -130,10 +122,8 @@ return destination\n ...@@ -130,10 +122,8 @@ return destination\n
<string>kw</string> <string>kw</string>
<string>_getattr_</string> <string>_getattr_</string>
<string>context</string> <string>context</string>
<string>destination</string> <string>mutilated_banknote</string>
<string>parent</string> <string>mutilated_banknote_source_trade</string>
<string>_getiter_</string>
<string>workflow_item</string>
<string>None</string> <string>None</string>
</tuple> </tuple>
</value> </value>
......
...@@ -67,11 +67,8 @@ ...@@ -67,11 +67,8 @@
<record id="2" aka="AAAAAAAAAAI="> <record id="2" aka="AAAAAAAAAAI=">
<pickle> <pickle>
<tuple> <tuple>
<tuple> <global name="Guard" module="Products.DCWorkflow.Guard"/>
<string>Products.DCWorkflow.Guard</string> <tuple/>
<string>Guard</string>
</tuple>
<none/>
</tuple> </tuple>
</pickle> </pickle>
<pickle> <pickle>
...@@ -97,18 +94,15 @@ ...@@ -97,18 +94,15 @@
<record id="3" aka="AAAAAAAAAAM="> <record id="3" aka="AAAAAAAAAAM=">
<pickle> <pickle>
<tuple> <tuple>
<tuple> <global name="Expression" module="Products.CMFCore.Expression"/>
<string>Products.CMFCore.Expression</string> <tuple/>
<string>Expression</string>
</tuple>
<none/>
</tuple> </tuple>
</pickle> </pickle>
<pickle> <pickle>
<dictionary> <dictionary>
<item> <item>
<key> <string>text</string> </key> <key> <string>text</string> </key>
<value> <string>python: "siege" not in here.getSource("")</string> </value> <value> <string>python: "siege" not in here.getSourceTrade("")</string> </value>
</item> </item>
</dictionary> </dictionary>
</pickle> </pickle>
......
...@@ -67,11 +67,8 @@ ...@@ -67,11 +67,8 @@
<record id="2" aka="AAAAAAAAAAI="> <record id="2" aka="AAAAAAAAAAI=">
<pickle> <pickle>
<tuple> <tuple>
<tuple> <global name="Guard" module="Products.DCWorkflow.Guard"/>
<string>Products.DCWorkflow.Guard</string> <tuple/>
<string>Guard</string>
</tuple>
<none/>
</tuple> </tuple>
</pickle> </pickle>
<pickle> <pickle>
...@@ -97,18 +94,15 @@ ...@@ -97,18 +94,15 @@
<record id="3" aka="AAAAAAAAAAM="> <record id="3" aka="AAAAAAAAAAM=">
<pickle> <pickle>
<tuple> <tuple>
<tuple> <global name="Expression" module="Products.CMFCore.Expression"/>
<string>Products.CMFCore.Expression</string> <tuple/>
<string>Expression</string>
</tuple>
<none/>
</tuple> </tuple>
</pickle> </pickle>
<pickle> <pickle>
<dictionary> <dictionary>
<item> <item>
<key> <string>text</string> </key> <key> <string>text</string> </key>
<value> <string>python: "siege" not in here.getSource("")</string> </value> <value> <string>python: "siege" not in here.getSourceTrade("")</string> </value>
</item> </item>
</dictionary> </dictionary>
</pickle> </pickle>
......
428 431
\ 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