Commit 11cecdbc authored by Aurel's avatar Aurel

fix many workflow (security + check in script)

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@9748 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 650ea97e
......@@ -78,11 +78,16 @@ transaction = state_change[\'object\']\n
vault = transaction.getSource()\n
resource = transaction.CashDelivery_checkCounterInventory(source=vault, portal_type=\'Cash Delivery Line\')\n
\n
if (\'encaisse_des_externes\' not in vault and \'encaisse_des_billets_retires_de_la_circulation\' not in vault):\n
msg = Message(domain="ui", message="Invalid source.")\n
raise ValidationFailed, (msg,)\n
\n
"""\n
if \'encaisse_des_billets_neufs_non_emis\' in vault :\n
msg = Message(domain="ui", message="Invalid source.")\n
\n
raise ValidationFailed, (msg,)\n
\n
"""\n
\n
# Get price and total_price.\n
amount = transaction.getSourceTotalAssetPrice()\n
......
......@@ -42,8 +42,6 @@
<tuple>
<string>deliver</string>
<string>deliver_action</string>
<string>reject</string>
<string>reject_action</string>
</tuple>
</value>
</item>
......
......@@ -46,8 +46,6 @@
<key> <string>transitions</string> </key>
<value>
<tuple>
<string>cancel</string>
<string>cancel_action</string>
<string>confirm</string>
<string>confirm_action</string>
</tuple>
......
......@@ -46,12 +46,12 @@
<key> <string>transitions</string> </key>
<value>
<tuple>
<string>cancel</string>
<string>cancel_action</string>
<string>deliver</string>
<string>order</string>
<string>order_action</string>
<string>plan_to_deliver_action</string>
<string>reject</string>
<string>reject_action</string>
</tuple>
</value>
</item>
......
......@@ -76,6 +76,11 @@ from Products.ERP5Type.Message import Message\n
transaction = state_change.object\n
\n
vault = transaction.getSource()\n
\n
if (\'encaisse_des_billets_et_monnaies\' not in vault):\n
msg = Message(domain="ui", message="Invalid source.")\n
raise ValidationFailed, (msg,)\n
\n
resource = transaction.CashDelivery_checkCounterInventory(source=vault, portal_type=\'Monetary Recall Line\')\n
\n
# Get price and total_price.\n
......@@ -102,6 +107,12 @@ elif resource <> 0 :\n
<none/>
</value>
</item>
<item>
<key> <string>_dav_writelocks</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
<item>
<key> <string>_filepath</string> </key>
<value> <string>Script (Python):/baobab/portal_workflow/monetary_recall_workflow/scripts/ValidateVaultBalance</string> </value>
......@@ -148,10 +159,10 @@ elif resource <> 0 :\n
<string>_getattr_</string>
<string>transaction</string>
<string>vault</string>
<string>msg</string>
<string>resource</string>
<string>amount</string>
<string>total_price</string>
<string>msg</string>
</tuple>
</value>
</item>
......@@ -179,4 +190,25 @@ elif resource <> 0 :\n
</dictionary>
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<tuple>
<tuple>
<string>Persistence</string>
<string>PersistentMapping</string>
</tuple>
<none/>
</tuple>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_container</string> </key>
<value>
<dictionary/>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
......@@ -78,9 +78,7 @@
<value>
<tuple>
<string>Assignor</string>
<string>Auditor</string>
<string>Manager</string>
<string>Owner</string>
</tuple>
</value>
</item>
......@@ -105,9 +103,7 @@
<value>
<tuple>
<string>Assignor</string>
<string>Auditor</string>
<string>Manager</string>
<string>Owner</string>
</tuple>
</value>
</item>
......
......@@ -46,10 +46,10 @@
<key> <string>transitions</string> </key>
<value>
<tuple>
<string>cancel</string>
<string>cancel_action</string>
<string>deliver</string>
<string>deliver_action</string>
<string>reject</string>
<string>reject_action</string>
</tuple>
</value>
</item>
......
......@@ -79,9 +79,7 @@
<tuple>
<string>Assignee</string>
<string>Assignor</string>
<string>Auditor</string>
<string>Manager</string>
<string>Owner</string>
</tuple>
</value>
</item>
......@@ -107,9 +105,7 @@
<tuple>
<string>Assignee</string>
<string>Assignor</string>
<string>Auditor</string>
<string>Manager</string>
<string>Owner</string>
</tuple>
</value>
</item>
......
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<tuple>
<tuple>
<string>Products.DCWorkflow.Transitions</string>
<string>TransitionDefinition</string>
</tuple>
<none/>
</tuple>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>__ac_local_roles__</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>_owner</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>actbox_category</string> </key>
<value> <string>workflow</string> </value>
</item>
<item>
<key> <string>actbox_name</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>actbox_url</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>after_script_name</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>description</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>guard</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>reject</string> </value>
</item>
<item>
<key> <string>new_state_id</string> </key>
<value> <string>draft</string> </value>
</item>
<item>
<key> <string>script_name</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Reject</string> </value>
</item>
<item>
<key> <string>trigger_type</string> </key>
<value> <int>2</int> </value>
</item>
</dictionary>
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<tuple>
<tuple>
<string>Products.DCWorkflow.Guard</string>
<string>Guard</string>
</tuple>
<none/>
</tuple>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>roles</string> </key>
<value>
<tuple>
<string>Assignee</string>
<string>Manager</string>
</tuple>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<tuple>
<tuple>
<string>Products.DCWorkflow.Transitions</string>
<string>TransitionDefinition</string>
</tuple>
<none/>
</tuple>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>__ac_local_roles__</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>_owner</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>actbox_category</string> </key>
<value> <string>workflow</string> </value>
</item>
<item>
<key> <string>actbox_name</string> </key>
<value> <string>Reject</string> </value>
</item>
<item>
<key> <string>actbox_url</string> </key>
<value> <string>%(content_url)s/BaseWorkflow_viewWorkflowActionDialog?workflow_action=reject_action</string> </value>
</item>
<item>
<key> <string>after_script_name</string> </key>
<value> <string>reject</string> </value>
</item>
<item>
<key> <string>description</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>guard</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>reject_action</string> </value>
</item>
<item>
<key> <string>new_state_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>script_name</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Reject Action</string> </value>
</item>
<item>
<key> <string>trigger_type</string> </key>
<value> <int>1</int> </value>
</item>
</dictionary>
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<tuple>
<tuple>
<string>Products.DCWorkflow.Guard</string>
<string>Guard</string>
</tuple>
<none/>
</tuple>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>roles</string> </key>
<value>
<tuple>
<string>Assignee</string>
<string>Manager</string>
</tuple>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
......@@ -67,6 +67,8 @@
<tuple>
<string>Assignee</string>
<string>Assignor</string>
<string>DestinationAssignee</string>
<string>DestinationAssignor</string>
<string>Manager</string>
</tuple>
</value>
......@@ -93,6 +95,8 @@
<tuple>
<string>Assignee</string>
<string>Assignor</string>
<string>DestinationAssignee</string>
<string>DestinationAssignor</string>
<string>Manager</string>
</tuple>
</value>
......
......@@ -67,6 +67,8 @@
<tuple>
<string>Assignee</string>
<string>Assignor</string>
<string>DestinationAssignee</string>
<string>DestinationAssignor</string>
<string>Manager</string>
</tuple>
</value>
......@@ -93,6 +95,8 @@
<tuple>
<string>Assignee</string>
<string>Assignor</string>
<string>DestinationAssignee</string>
<string>DestinationAssignor</string>
<string>Manager</string>
</tuple>
</value>
......
......@@ -78,6 +78,8 @@
<tuple>
<string>Assignee</string>
<string>Assignor</string>
<string>DestinationAssignee</string>
<string>DestinationAssignor</string>
<string>Manager</string>
<string>Owner</string>
</tuple>
......@@ -109,6 +111,8 @@
<tuple>
<string>Assignee</string>
<string>Assignor</string>
<string>DestinationAssignee</string>
<string>DestinationAssignor</string>
<string>Manager</string>
<string>Owner</string>
</tuple>
......
......@@ -78,6 +78,7 @@
<tuple>
<string>Assignee</string>
<string>Assignor</string>
<string>DestinationAssignee</string>
<string>DestinationAssignor</string>
<string>Manager</string>
</tuple>
......@@ -105,6 +106,7 @@
<tuple>
<string>Assignee</string>
<string>Assignor</string>
<string>DestinationAssignee</string>
<string>DestinationAssignor</string>
<string>Manager</string>
</tuple>
......
......@@ -78,6 +78,8 @@
<tuple>
<string>Assignee</string>
<string>Assignor</string>
<string>DestinationAssignee</string>
<string>DestinationAssignor</string>
<string>Manager</string>
</tuple>
</value>
......@@ -104,6 +106,8 @@
<tuple>
<string>Assignee</string>
<string>Assignor</string>
<string>DestinationAssignee</string>
<string>DestinationAssignor</string>
<string>Manager</string>
</tuple>
</value>
......
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