Commit 8cbbbd3f authored by Julien Muchembled's avatar Julien Muchembled

Update delivery_causality_workflow and related workflows so that no workflow...

Update delivery_causality_workflow and related workflows so that no workflow method is called when the transition doesn't exist for the current state.
Also update permissions of states so that they are consistent with the workflow logic: make "building" and "solving" non-editable.

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@27840 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent e9d445db
......@@ -53,10 +53,22 @@
</item>
<item>
<key> <string>_body</string> </key>
<value> <string>object = state_change[\'object\']\n
#object.log(\'propaging edit on delivery\', object.getRootDeliveryValue().getRelativeUrl())\n
if getattr(object.getRootDeliveryValue(), \'calculate\', None) is not None:\n
object.getRootDeliveryValue().calculate()\n
<value> <string># Note that delivery may have no causality state.\n
# For instance, Accounting Transaction Lines\n
# can be contained in a Accounting Rule Cell\n
# of a Invoice Transaction Rule, and none of\n
# these provide a causality workflow, but\n
# Accounting Transaction Line is also a\n
# possible child of a Accounting Transaction\n
# in the Accounting Transaction Module\n
\n
portal = context.getPortalObject()\n
if portal.portal_workflow.isTransitionPossible(context, \'calculate\'):\n
context.calculate()\n
else:\n
# Make sure no other node is moving the delivery\n
# to \'diverged\' or \'solved\' state.\n
context.serialize()\n
</string> </value>
</item>
<item>
......@@ -67,7 +79,7 @@ if getattr(object.getRootDeliveryValue(), \'calculate\', None) is not None:\n
</item>
<item>
<key> <string>_params</string> </key>
<value> <string>state_change</string> </value>
<value> <string></string> </value>
</item>
<item>
<key> <string>errors</string> </key>
......@@ -87,18 +99,15 @@ if getattr(object.getRootDeliveryValue(), \'calculate\', None) is not None:\n
<dictionary>
<item>
<key> <string>co_argcount</string> </key>
<value> <int>1</int> </value>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>co_varnames</string> </key>
<value>
<tuple>
<string>state_change</string>
<string>_getitem_</string>
<string>object</string>
<string>getattr</string>
<string>_getattr_</string>
<string>None</string>
<string>context</string>
<string>portal</string>
</tuple>
</value>
</item>
......@@ -115,7 +124,7 @@ if getattr(object.getRootDeliveryValue(), \'calculate\', None) is not None:\n
</item>
<item>
<key> <string>id</string> </key>
<value> <string>AmortisationTransactionContent_afterEdit</string> </value>
<value> <string>Delivery_calculate</string> </value>
</item>
<item>
<key> <string>warnings</string> </key>
......
......@@ -53,12 +53,7 @@
</item>
<item>
<key> <string>_body</string> </key>
<value> <string>delivery = state_change[\'object\']\n
\n
getCausalityState = getattr(delivery, \'getCausalityState\', None)\n
\n
if getCausalityState is not None and getCausalityState() != \'draft\':\n
delivery.calculate()\n
<value> <string>state_change[\'object\'].Delivery_calculate()\n
</string> </value>
</item>
<item>
......@@ -96,12 +91,8 @@ if getCausalityState is not None and getCausalityState() != \'draft\':\n
<value>
<tuple>
<string>state_change</string>
<string>_getitem_</string>
<string>delivery</string>
<string>getattr</string>
<string>None</string>
<string>getCausalityState</string>
<string>_getattr_</string>
<string>_getitem_</string>
</tuple>
</value>
</item>
......
......@@ -33,6 +33,7 @@
<tuple>
<string>converge</string>
<string>diverge</string>
<string>start_building</string>
</tuple>
</value>
</item>
......@@ -62,16 +63,7 @@
<key> <string>Add portal content</string> </key>
<value>
<tuple>
<string>Assignee</string>
<string>Assignor</string>
<string>Associate</string>
<string>Auditor</string>
<string>Authenticated</string>
<string>Author</string>
<string>Manager</string>
<string>Member</string>
<string>Owner</string>
<string>Reviewer</string>
</tuple>
</value>
</item>
......@@ -79,16 +71,7 @@
<key> <string>Modify portal content</string> </key>
<value>
<tuple>
<string>Assignee</string>
<string>Assignor</string>
<string>Associate</string>
<string>Auditor</string>
<string>Authenticated</string>
<string>Author</string>
<string>Manager</string>
<string>Member</string>
<string>Owner</string>
<string>Reviewer</string>
</tuple>
</value>
</item>
......
......@@ -33,6 +33,7 @@
<tuple>
<string>calculate</string>
<string>converge</string>
<string>diverge</string>
<string>solve_divergence</string>
<string>solve_divergence_action</string>
<string>split_and_defer</string>
......
......@@ -32,6 +32,7 @@
<value>
<tuple>
<string>calculate</string>
<string>converge</string>
<string>diverge</string>
<string>start_building</string>
</tuple>
......
......@@ -53,23 +53,7 @@
</item>
<item>
<key> <string>_body</string> </key>
<value> <string>delivery_movement = state_change[\'object\']\n
\n
delivery = delivery_movement.getExplanationValue()\n
\n
# Check that getCausalityState is available.\n
# For instance, Accounting Transaction Lines\n
# can be contained in a Accounting Rule Cell\n
# of a Invoice Transaction Rule, and none of\n
# these provide a causality workflow, but\n
# Accounting Transaction Line is also a\n
# possible child of a Accounting Transaction\n
# in the Accounting Transaction Module\n
\n
getCausalityState = getattr(delivery, \'getCausalityState\', None)\n
\n
if getCausalityState is not None and getCausalityState() != \'draft\':\n
delivery.calculate()\n
<value> <string>state_change[\'object\'].getExplanationValue().Delivery_calculate()\n
</string> </value>
</item>
<item>
......@@ -107,13 +91,8 @@ if getCausalityState is not None and getCausalityState() != \'draft\':\n
<value>
<tuple>
<string>state_change</string>
<string>_getitem_</string>
<string>delivery_movement</string>
<string>_getattr_</string>
<string>delivery</string>
<string>getattr</string>
<string>None</string>
<string>getCausalityState</string>
<string>_getitem_</string>
</tuple>
</value>
</item>
......
......@@ -59,15 +59,7 @@ delivery_movement = simulation_movement.getDeliveryValue()\n
\n
if delivery_movement is not None:\n
delivery = delivery_movement.getExplanationValue()\n
# Because Payment Transaction does not have a causality workflow, we cannot assume that\n
# getCausalityState will always be present. This getattr test needs to be removed once\n
# Payment Transaction is linked to a correct causality workflow.\n
getCausalityState = getattr(delivery, \'getCausalityState\', None)\n
\n
if getCausalityState is not None and getCausalityState() != \'draft\':\n
delivery.activate(\n
after_path_and_method_id=(delivery_movement.getPath(),\n
(\'recursiveImmediateReindexObject\', \'immediateReindexObject\'))).calculate()\n
delivery.activate().Delivery_calculate()\n
</string> </value>
</item>
<item>
......@@ -129,8 +121,6 @@ if delivery_movement is not None:\n
<string>delivery_movement</string>
<string>None</string>
<string>delivery</string>
<string>getattr</string>
<string>getCausalityState</string>
</tuple>
</value>
</item>
......
604
\ No newline at end of file
605
\ No newline at end of file
......@@ -32,9 +32,7 @@
<value>
<tuple>
<string>accept_decision</string>
<string>accept_decision_action</string>
<string>adopt_prevision</string>
<string>adopt_prevision_action</string>
<string>converge</string>
<string>diverge</string>
<string>start_building</string>
......
......@@ -37,6 +37,7 @@
<string>adopt_prevision_action</string>
<string>calculate</string>
<string>converge</string>
<string>diverge</string>
<string>start_building</string>
</tuple>
</value>
......
......@@ -32,6 +32,7 @@
<value>
<tuple>
<string>calculate</string>
<string>converge</string>
<string>diverge</string>
<string>start_building</string>
</tuple>
......
......@@ -33,7 +33,6 @@
<tuple>
<string>converge</string>
<string>diverge</string>
<string>start_building</string>
</tuple>
</value>
</item>
......@@ -49,17 +48,14 @@
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<tuple>
<tuple>
<string>Persistence</string>
<string>PersistentMapping</string>
</tuple>
<none/>
<global name="PersistentMapping" module="Persistence.mapping"/>
<tuple/>
</tuple>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_container</string> </key>
<key> <string>data</string> </key>
<value>
<dictionary>
<item>
......@@ -93,7 +89,6 @@
<key> <string>Modify portal content</string> </key>
<value>
<tuple>
<string>Assignor</string>
<string>Manager</string>
</tuple>
</value>
......
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<tuple>
<global name="InteractionWorkflowDefinition" module="Products.ERP5.InteractionWorkflow"/>
<tuple/>
</tuple>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_objects</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>groups</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>amortisation_transaction_interaction_workflow</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<tuple>
<global name="Interaction" module="Products.ERP5.Interaction"/>
<tuple/>
</tuple>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_mapping</string> </key>
<value>
<dictionary/>
</value>
</item>
<item>
<key> <string>_objects</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>interactions</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<tuple>
<global name="InteractionDefinition" module="Products.ERP5.Interaction"/>
<tuple/>
</tuple>
</pickle>
<pickle>
<dictionary>
<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>activate_script_name</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>after_script_name</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>description</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>guard</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>AmortisationTransactionContent_delete</string> </value>
</item>
<item>
<key> <string>method_id</string> </key>
<value>
<list>
<string>manage_beforeDelete</string>
</list>
</value>
</item>
<item>
<key> <string>portal_type_filter</string> </key>
<value>
<list>
<string>Amortisation Transaction Line</string>
</list>
</value>
</item>
<item>
<key> <string>script_name</string> </key>
<value>
<list>
<string>AmortisationTransactionContent_updateRelatedSimulationMovement</string>
</list>
</value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>trigger_type</string> </key>
<value> <int>2</int> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<tuple>
<global name="InteractionDefinition" module="Products.ERP5.Interaction"/>
<tuple/>
</tuple>
</pickle>
<pickle>
<dictionary>
<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>activate_script_name</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>after_script_name</string> </key>
<value>
<list>
<string>AmortisationTransactionContent_afterEdit</string>
</list>
</value>
</item>
<item>
<key> <string>description</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>guard</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>AmortisationTransactionContent_edit</string> </value>
</item>
<item>
<key> <string>method_id</string> </key>
<value>
<list>
<string>_edit</string>
</list>
</value>
</item>
<item>
<key> <string>portal_type_filter</string> </key>
<value>
<list>
<string>Amortisation Transaction Line</string>
</list>
</value>
</item>
<item>
<key> <string>script_name</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Repercute edit() on root delivery</string> </value>
</item>
<item>
<key> <string>trigger_type</string> </key>
<value> <int>2</int> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<tuple>
<global name="InteractionDefinition" module="Products.ERP5.Interaction"/>
<tuple/>
</tuple>
</pickle>
<pickle>
<dictionary>
<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>activate_script_name</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>after_script_name</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>description</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>guard</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>AmortisationTransaction_delete</string> </value>
</item>
<item>
<key> <string>method_id</string> </key>
<value>
<list>
<string>manage_beforeDelete</string>
</list>
</value>
</item>
<item>
<key> <string>portal_type_filter</string> </key>
<value>
<list>
<string>Amortisation Transaction</string>
</list>
</value>
</item>
<item>
<key> <string>script_name</string> </key>
<value>
<list>
<string>AmortisationTransaction_updateRelatedSimulationMovement</string>
</list>
</value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>trigger_type</string> </key>
<value> <int>2</int> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<tuple>
<global name="Scripts" module="Products.DCWorkflow.Scripts"/>
<tuple/>
</tuple>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_mapping</string> </key>
<value>
<dictionary/>
</value>
</item>
<item>
<key> <string>_objects</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>scripts</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<tuple>
<global name="PythonScript" module="Products.PythonScripts.PythonScript"/>
<tuple/>
</tuple>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>Script_magic</string> </key>
<value> <int>3</int> </value>
</item>
<item>
<key> <string>_bind_names</string> </key>
<value>
<object>
<klass>
<global name="NameAssignments" module="Shared.DC.Scripts.Bindings"/>
</klass>
<tuple/>
<state>
<dictionary>
<item>
<key> <string>_asgns</string> </key>
<value>
<dictionary>
<item>
<key> <string>name_container</string> </key>
<value> <string>container</string> </value>
</item>
<item>
<key> <string>name_context</string> </key>
<value> <string>context</string> </value>
</item>
<item>
<key> <string>name_m_self</string> </key>
<value> <string>script</string> </value>
</item>
<item>
<key> <string>name_subpath</string> </key>
<value> <string>traverse_subpath</string> </value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key> <string>_body</string> </key>
<value> <string>line = state_change[\'object\']\n
# Clean simulation\n
for simulation_movement in line.getDeliveryRelatedValueList():\n
if simulation_movement.getDelivery() == line.getRelativeUrl():\n
simulation_movement.setDelivery(None)\n
</string> </value>
</item>
<item>
<key> <string>_code</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>_params</string> </key>
<value> <string>state_change</string> </value>
</item>
<item>
<key> <string>_proxy_roles</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>errors</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>func_code</string> </key>
<value>
<object>
<klass>
<global name="FuncCode" module="Shared.DC.Scripts.Signature"/>
</klass>
<tuple/>
<state>
<dictionary>
<item>
<key> <string>co_argcount</string> </key>
<value> <int>1</int> </value>
</item>
<item>
<key> <string>co_varnames</string> </key>
<value>
<tuple>
<string>state_change</string>
<string>_getitem_</string>
<string>line</string>
<string>_getiter_</string>
<string>_getattr_</string>
<string>simulation_movement</string>
<string>None</string>
</tuple>
</value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key> <string>func_defaults</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>AmortisationTransactionContent_updateRelatedSimulationMovement</string> </value>
</item>
<item>
<key> <string>warnings</string> </key>
<value>
<tuple/>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<tuple>
<global name="PythonScript" module="Products.PythonScripts.PythonScript"/>
<tuple/>
</tuple>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>Script_magic</string> </key>
<value> <int>3</int> </value>
</item>
<item>
<key> <string>_bind_names</string> </key>
<value>
<object>
<klass>
<global name="NameAssignments" module="Shared.DC.Scripts.Bindings"/>
</klass>
<tuple/>
<state>
<dictionary>
<item>
<key> <string>_asgns</string> </key>
<value>
<dictionary>
<item>
<key> <string>name_container</string> </key>
<value> <string>container</string> </value>
</item>
<item>
<key> <string>name_context</string> </key>
<value> <string>context</string> </value>
</item>
<item>
<key> <string>name_m_self</string> </key>
<value> <string>script</string> </value>
</item>
<item>
<key> <string>name_subpath</string> </key>
<value> <string>traverse_subpath</string> </value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key> <string>_body</string> </key>
<value> <string>delivery = state_change[\'object\']\n
# Clean simulation\n
for line in delivery.getMovementList():\n
for simulation_movement in line.getDeliveryRelatedValueList():\n
if simulation_movement.getDelivery() == line.getRelativeUrl():\n
simulation_movement.setDelivery(None)\n
</string> </value>
</item>
<item>
<key> <string>_code</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>_params</string> </key>
<value> <string>state_change</string> </value>
</item>
<item>
<key> <string>_proxy_roles</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>errors</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>func_code</string> </key>
<value>
<object>
<klass>
<global name="FuncCode" module="Shared.DC.Scripts.Signature"/>
</klass>
<tuple/>
<state>
<dictionary>
<item>
<key> <string>co_argcount</string> </key>
<value> <int>1</int> </value>
</item>
<item>
<key> <string>co_varnames</string> </key>
<value>
<tuple>
<string>state_change</string>
<string>_getitem_</string>
<string>delivery</string>
<string>_getiter_</string>
<string>_getattr_</string>
<string>line</string>
<string>simulation_movement</string>
<string>None</string>
</tuple>
</value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key> <string>func_defaults</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>AmortisationTransaction_updateRelatedSimulationMovement</string> </value>
</item>
<item>
<key> <string>warnings</string> </key>
<value>
<tuple/>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<tuple>
<global name="Variables" module="Products.DCWorkflow.Variables"/>
<tuple/>
</tuple>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_mapping</string> </key>
<value>
<dictionary/>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>variables</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<tuple>
<global name="Worklists" module="Products.DCWorkflow.Worklists"/>
<tuple/>
</tuple>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_mapping</string> </key>
<value>
<dictionary/>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>worklists</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
......@@ -36,6 +36,12 @@
</list>
</value>
</item>
<item>
<key> <string>before_commit_script_name</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>description</string> </key>
<value> <string></string> </value>
......@@ -54,8 +60,7 @@
<key> <string>method_id</string> </key>
<value>
<list>
<string>_set*</string>
<string>_edit</string>
<string>_set.*</string>
</list>
</value>
</item>
......
157
\ No newline at end of file
158
\ No newline at end of file
amortisation_transaction_causality_workflow
amortisation_transaction_interaction_workflow
immobilisation_delivery_workflow
immobilisation_movement_interaction_workflow
immobilisation_workflow
\ 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