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 @@
</item>
<item>
<key> <string>_body</string> </key>
<value> <string>destination = "%s/surface/caisse_courante/encaisse_des_billets_et_monnaies" %(context.getSourceTrade(),)\n
\n
# If it was sent to headquarters, the destination\n
# must be None\n
parent = context.getParentValue()\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
<value> <string>mutilated_banknote = context.getParentValue()\n
mutilated_banknote_source_trade = mutilated_banknote.getSourceTrade(\'\')\n
if \'siege\' not in mutilated_banknote_source_trade and mutilated_banknote.getWorkflowState() in (\'finished\', \'delivered\'):\n
return "%s/surface/caisse_courante/encaisse_des_billets_et_monnaies" % (mutilated_banknote_source_trade, )\n
return None\n
</string> </value>
</item>
<item>
......@@ -130,10 +122,8 @@ return destination\n
<string>kw</string>
<string>_getattr_</string>
<string>context</string>
<string>destination</string>
<string>parent</string>
<string>_getiter_</string>
<string>workflow_item</string>
<string>mutilated_banknote</string>
<string>mutilated_banknote_source_trade</string>
<string>None</string>
</tuple>
</value>
......
......@@ -67,11 +67,8 @@
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<tuple>
<tuple>
<string>Products.DCWorkflow.Guard</string>
<string>Guard</string>
</tuple>
<none/>
<global name="Guard" module="Products.DCWorkflow.Guard"/>
<tuple/>
</tuple>
</pickle>
<pickle>
......@@ -97,18 +94,15 @@
<record id="3" aka="AAAAAAAAAAM=">
<pickle>
<tuple>
<tuple>
<string>Products.CMFCore.Expression</string>
<string>Expression</string>
</tuple>
<none/>
<global name="Expression" module="Products.CMFCore.Expression"/>
<tuple/>
</tuple>
</pickle>
<pickle>
<dictionary>
<item>
<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>
</dictionary>
</pickle>
......
......@@ -67,11 +67,8 @@
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<tuple>
<tuple>
<string>Products.DCWorkflow.Guard</string>
<string>Guard</string>
</tuple>
<none/>
<global name="Guard" module="Products.DCWorkflow.Guard"/>
<tuple/>
</tuple>
</pickle>
<pickle>
......@@ -97,18 +94,15 @@
<record id="3" aka="AAAAAAAAAAM=">
<pickle>
<tuple>
<tuple>
<string>Products.CMFCore.Expression</string>
<string>Expression</string>
</tuple>
<none/>
<global name="Expression" module="Products.CMFCore.Expression"/>
<tuple/>
</tuple>
</pickle>
<pickle>
<dictionary>
<item>
<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>
</dictionary>
</pickle>
......
428
\ No newline at end of file
431
\ 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