diff --git a/product/ERP5/bootstrap/erp5_core/WorkflowTemplateItem/portal_workflow/component_validation_workflow.xml b/product/ERP5/bootstrap/erp5_core/WorkflowTemplateItem/portal_workflow/component_validation_workflow.xml index 3591bbec330dbbc0363f730b958fe37c85a31ab8..e0980777e692237fb931c8c4fbde7309d10b6727 100644 --- a/product/ERP5/bootstrap/erp5_core/WorkflowTemplateItem/portal_workflow/component_validation_workflow.xml +++ b/product/ERP5/bootstrap/erp5_core/WorkflowTemplateItem/portal_workflow/component_validation_workflow.xml @@ -52,7 +52,7 @@ </item> <item> <key> <string>title</string> </key> - <value> <string>Validation Workflow</string> </value> + <value> <string>Component Validation Workflow</string> </value> </item> </dictionary> </pickle> diff --git a/product/ERP5/bootstrap/erp5_core/WorkflowTemplateItem/portal_workflow/component_validation_workflow/scripts/deleteObject.xml b/product/ERP5/bootstrap/erp5_core/WorkflowTemplateItem/portal_workflow/component_validation_workflow/scripts/deleteObject.xml new file mode 100644 index 0000000000000000000000000000000000000000..4544c8dc491908e4f697a53a0dc0f7e551c634d4 --- /dev/null +++ b/product/ERP5/bootstrap/erp5_core/WorkflowTemplateItem/portal_workflow/component_validation_workflow/scripts/deleteObject.xml @@ -0,0 +1,69 @@ +<?xml version="1.0"?> +<ZopeData> + <record id="1" aka="AAAAAAAAAAE="> + <pickle> + <global name="PythonScript" module="Products.PythonScripts.PythonScript"/> + </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>document = state_change[\'object\']\n +container = document.getParentValue()\n +container.manage_delObjects(ids=[document.getId()])\n +</string> </value> + </item> + <item> + <key> <string>_params</string> </key> + <value> <string>state_change</string> </value> + </item> + <item> + <key> <string>id</string> </key> + <value> <string>deleteObject</string> </value> + </item> + </dictionary> + </pickle> + </record> +</ZopeData> diff --git a/product/ERP5/bootstrap/erp5_core/WorkflowTemplateItem/portal_workflow/component_validation_workflow/transitions/delete.xml b/product/ERP5/bootstrap/erp5_core/WorkflowTemplateItem/portal_workflow/component_validation_workflow/transitions/delete.xml deleted file mode 100644 index c258c14dec8aa5d3b0ba489f9478a5fdae0bed21..0000000000000000000000000000000000000000 --- a/product/ERP5/bootstrap/erp5_core/WorkflowTemplateItem/portal_workflow/component_validation_workflow/transitions/delete.xml +++ /dev/null @@ -1,58 +0,0 @@ -<?xml version="1.0"?> -<ZopeData> - <record id="1" aka="AAAAAAAAAAE="> - <pickle> - <global name="TransitionDefinition" module="Products.DCWorkflow.Transitions"/> - </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>after_script_name</string> </key> - <value> <string></string> </value> - </item> - <item> - <key> <string>description</string> </key> - <value> <string>Delete a document in ERP5</string> </value> - </item> - <item> - <key> <string>guard</string> </key> - <value> - <none/> - </value> - </item> - <item> - <key> <string>id</string> </key> - <value> <string>delete</string> </value> - </item> - <item> - <key> <string>new_state_id</string> </key> - <value> <string>deleted</string> </value> - </item> - <item> - <key> <string>script_name</string> </key> - <value> <string></string> </value> - </item> - <item> - <key> <string>title</string> </key> - <value> <string>Delete</string> </value> - </item> - <item> - <key> <string>trigger_type</string> </key> - <value> <int>2</int> </value> - </item> - </dictionary> - </pickle> - </record> -</ZopeData> diff --git a/product/ERP5/bootstrap/erp5_core/WorkflowTemplateItem/portal_workflow/component_validation_workflow/transitions/delete_action.xml b/product/ERP5/bootstrap/erp5_core/WorkflowTemplateItem/portal_workflow/component_validation_workflow/transitions/delete_action.xml index 8dbec5ba9e5e92c20ea700a2eb1ae1c4ed00278b..cf6ab50f8ac2059f87304d4c9318a734d18296ca 100644 --- a/product/ERP5/bootstrap/erp5_core/WorkflowTemplateItem/portal_workflow/component_validation_workflow/transitions/delete_action.xml +++ b/product/ERP5/bootstrap/erp5_core/WorkflowTemplateItem/portal_workflow/component_validation_workflow/transitions/delete_action.xml @@ -10,6 +10,10 @@ <key> <string>actbox_category</string> </key> <value> <string>workflow</string> </value> </item> + <item> + <key> <string>actbox_icon</string> </key> + <value> <string></string> </value> + </item> <item> <key> <string>actbox_name</string> </key> <value> <string></string> </value> @@ -20,7 +24,7 @@ </item> <item> <key> <string>after_script_name</string> </key> - <value> <string>delete</string> </value> + <value> <string>deleteObject</string> </value> </item> <item> <key> <string>description</string> </key> diff --git a/product/ERP5/bootstrap/erp5_core/bt/change_log b/product/ERP5/bootstrap/erp5_core/bt/change_log index 640c129cbe7053a3e4de55682e91000dd4e3ab44..a8a615a4229798d09c64b2213472573a0b221dc1 100644 --- a/product/ERP5/bootstrap/erp5_core/bt/change_log +++ b/product/ERP5/bootstrap/erp5_core/bt/change_log @@ -1,3 +1,6 @@ +2013-06-26 arnaud.fontaine +* ZODB Components: Must be able to really delete a Component and not only in 'deleted' state. Folder_delete calls Workflow 'delete_action' if the object has any Workflow History. Before, component_validation_workflow was acting like validation_workflow for deleting objects, e.g. 'delete_action' triggers 'delete' state which is fine for normal documents but not Components. + 2013-06-25 arnaud.fontaine * ZODB Components: Migration must be all or nothing to avoid partial modifications of bt5 properties. diff --git a/product/ERP5/bootstrap/erp5_core/bt/revision b/product/ERP5/bootstrap/erp5_core/bt/revision index e7c00bf5cb54b88cbb8a817ec1328e5f7b26571e..1ed9f1650d8ab2144801f3cd0f43fae482acd9e5 100644 --- a/product/ERP5/bootstrap/erp5_core/bt/revision +++ b/product/ERP5/bootstrap/erp5_core/bt/revision @@ -1 +1 @@ -41112 \ No newline at end of file +41113 \ No newline at end of file diff --git a/product/ERP5Type/tests/testDynamicClassGeneration.py b/product/ERP5Type/tests/testDynamicClassGeneration.py index 37be08b38d645e33e7d73d679317a69fbb25b142..0a2d11eb1c3cf71968953e5e3d8800533b768c4a 100644 --- a/product/ERP5Type/tests/testDynamicClassGeneration.py +++ b/product/ERP5Type/tests/testDynamicClassGeneration.py @@ -1343,7 +1343,7 @@ class _TestZodbComponent(SecurityTestCase): fromlist=[self._getComponentModuleName()], level=0) - def testValidateInvalidate(self): + def testValidateInvalidateDelete(self): """ The new Component should only be in erp5.component.XXX when validated, otherwise it should not be importable at all @@ -1364,6 +1364,17 @@ class _TestZodbComponent(SecurityTestCase): self.tic() self.assertModuleImportable('TestValidateInvalidateComponent') + test_component.invalidate() + self.tic() + self.failIfModuleImportable('TestValidateInvalidateComponent') + + self.portal.portal_workflow.doActionFor(test_component, 'delete_action') + self.tic() + self.failIfModuleImportable('TestValidateInvalidateComponent') + self.assertEqual([o for o in self.portal.portal_components.contentValues() + if o.getReference() == 'TestValidateInvalidateComponent'], + []) + def testReferenceWithReservedKeywords(self): """ Check whether checkConsistency has been properly implemented for checking