Commit 1e4af19c authored by wenjie.zheng's avatar wenjie.zheng Committed by Sebastien Robin

erp5_workflow: rename chain_by_type repair script; add a type check in convertion workflow.

parent d5ebc15e
......@@ -89,14 +89,14 @@ for dc_wf in selected_wf_list:\n
\n
type_workflow_dict = context.getChainsByType()\n
for ptype_id in type_workflow_dict:\n
ptype = getattr(context.getPortalObject().portal_types, ptype_id)\n
# 1. clean DC workflow assignement:\n
context.delTypeCBT(ptype.id, dc_wf.id)\n
\n
# 2. assign ERP5 Workflow to portal type:\n
type_workflow_list = ptype.getTypeWorkflowList()\n
if workflow.getId() not in type_workflow_list:\n
ptype.addTypeWorkflowList(workflow.getId())\n
ptype = getattr(context.getPortalObject().portal_types, ptype_id, None)\n
if ptype is not None:\n
# 1. clean DC workflow assignement:\n
context.delTypeCBT(ptype.id, dc_wf.id)\n
# 2. assign ERP5 Workflow to portal type:\n
type_workflow_list = ptype.getTypeWorkflowList()\n
if workflow.getId() not in type_workflow_list:\n
ptype.addTypeWorkflowList(workflow.getId())\n
\n
return RESPONSE.redirect("%s/view?portal_status_message=Workflow+%s+converted"\n
%(context.absolute_url(), \',+\'.join(selected_wf_id_list)))\n
......
......@@ -56,7 +56,7 @@ for ptype in context.getPortalObject().portal_types.objectValues():\n
\n
"""\n
# rapair _chains_by_type\n
type_workflow_dict = {\'Category\': (\'edit_workflow\',), \'Dynamic Category Property\': (\'dynamic_class_generation_interaction_workflow\',), \'System Preference\': (\'edit_workflow\', \'preference_workflow\'), \'Bug Line\': (\'edit_workflow\', \'bug_event_workflow\'), \'Embedded Folder\': (\'edit_workflow\', \'embedded_workflow\'), \'Test Component\': (\'edit_workflow\', \'dynamic_class_generation_interaction_workflow\', \'component_validation_workflow\'), \'Base Category\': (\'edit_workflow\', \'dynamic_class_generation_interaction_workflow\'), \'Organisation\': (\'validation_workflow\', \'edit_workflow\'), \'Property Type Validity Constraint\': (\'dynamic_class_generation_interaction_workflow\',), \'Property Existence Constraint\': (\'dynamic_class_generation_interaction_workflow\',), \'Action Information\': (\'base_type_interaction_workflow\',), \'ERP5Workflow Test Document\': (\'testing_workflow\', \'testing_interaction_workflow\', \'edit_workflow\'), \'Document\': (\'edit_workflow\',), \'Email\': (\'edit_workflow\',), \'Career\': (\'career_workflow\',), \'Document Component\': (\'edit_workflow\', \'dynamic_class_generation_interaction_workflow\', \'component_validation_workflow\'), \'Category Acquired Membership State Constraint\': (\'dynamic_class_generation_interaction_workflow\',), \'Predicate\': (\'rule_interaction_workflow\', \'edit_workflow\'), \'Category Tool\': (\'dynamic_class_generation_interaction_workflow\',), \'Attribute Unicity Constraint\': (\'dynamic_class_generation_interaction_workflow\',), \'Role Definition\': (\'edit_workflow\', \'local_permission_interaction_workflow\'), \'Category Membership State Constraint\': (\'dynamic_class_generation_interaction_workflow\',), \'Assignment\': (\'edit_workflow\', \'assignment_workflow\'), \'Distributed Ram Cache\': (\'distributed_ram_cache_interaction_workflow\',), \'Rounding Model\': (\'validation_workflow\',), \'Component\': (\'validation_workflow\', \'edit_workflow\'), \'Configuration Save\': (\'edit_workflow\',), \'Link\': (\'edit_workflow\',), \'Preference\': (\'edit_workflow\', \'preference_workflow\'), \'Address\': (\'edit_workflow\',), \'TALES Constraint\': (\'dynamic_class_generation_interaction_workflow\',), \'Category Property\': (\'dynamic_class_generation_interaction_workflow\',), \'Category Related Membership Arity Constraint\': (\'dynamic_class_generation_interaction_workflow\',), \'Content Existence Constraint\': (\'dynamic_class_generation_interaction_workflow\',), \'Notification Message\': (\'document_security_interaction_workflow\', \'notification_message_workflow\', \'processing_status_workflow\', \'document_conversion_interaction_workflow\', \'edit_workflow\'), \'Acquired Property\': (\'dynamic_class_generation_interaction_workflow\',), \'Property Sheet\': (\'dynamic_class_generation_interaction_workflow\',), \'Embedded File\': (\'edit_workflow\', \'embedded_workflow\', \'document_conversion_interaction_workflow\'), \'Category Membership Arity Constraint\': (\'dynamic_class_generation_interaction_workflow\',), \'Category Related Membership State Constraint\': (\'dynamic_class_generation_interaction_workflow\',), \'Alarm\': (\'edit_workflow\',), \'Bank Account\': (\'validation_workflow\', \'edit_workflow\'), \'Fax\': (\'edit_workflow\',), \'Mapped Value\': (\'edit_workflow\',), \'Business Template\': (\'business_template_building_workflow\', \'business_template_installation_workflow\'), \'Memcached Plugin\': (\'memcached_plugin_interaction_workflow\',), \'Attribute Blacklisted Constraint\': (\'dynamic_class_generation_interaction_workflow\',), \'Category Existence Constraint\': (\'dynamic_class_generation_interaction_workflow\',), \'Query\': (\'edit_workflow\', \'query_workflow\'), \'Attribute Equality Constraint\': (\'dynamic_class_generation_interaction_workflow\',), \'Simulation Movement\': (\'simulation_movement_causality_interaction_workflow\',), \'Person\': (\'validation_workflow\', \'edit_workflow\', \'person_interaction_workflow\', \'user_account_workflow\'), \'File\': (\'document_security_interaction_workflow\', \'document_conversion_interaction_workflow\', \'edit_workflow\'), \'ERP5Workflow Test Object\': (\'dc_test_workflow\',), \'Glossary Term\': (\'validation_workflow\', \'edit_workflow\'), \'Telephone\': (\'edit_workflow\',), \'Agent\': (\'edit_workflow\',), \'Bug\': (\'edit_workflow\', \'bug_workflow\'), \'String Attribute Match Constraint\': (\'dynamic_class_generation_interaction_workflow\',), \'Currency\': (\'validation_workflow\', \'edit_workflow\'), \'Base Type\': (\'dynamic_class_generation_interaction_workflow\', \'base_type_interaction_workflow\'), \'Extension Component\': (\'edit_workflow\', \'dynamic_class_generation_interaction_workflow\', \'component_validation_workflow\'), \'Chat Address\': (\'edit_workflow\',), \'Credit Card\': (\'validation_workflow\', \'edit_workflow\'), \'Currency Exchange Line\': (\'currency_exchange_line_interaction_workflow\', \'edit_workflow\', \'validation_workflow\'), \'Business Configuration\': (\'validation_workflow\', \'edit_workflow\', \'business_configuration_simulation_workflow\'), \'Standard Property\': (\'dynamic_class_generation_interaction_workflow\',), \'Image\': (\'document_security_interaction_workflow\', \'document_conversion_interaction_workflow\', \'edit_workflow\'), \'Property Sheet Tool\': (\'dynamic_class_generation_interaction_workflow\',)} \n
type_workflow_dict = {\'Category\': (\'edit_workflow\',), \'Dynamic Category Property\': (\'dynamic_class_generation_interacti\', \'preference_workflow\'), \'Bug Line\': (\'edit_workflow\', \'bug_event_workflow\'), \'Embedded Folder\': (\'edit_workflow\', \'embedded_workflow\'), \'Test Component\': (\'edit_workflow\', \'dynamic_class_generation_interaction_workflow\', \'component_validation_workflow\'), \'Base Category\': (\'edit_workflow\', \'dynamic_class_generation_interaction_workflow\'), \'Organisation\': (\'validation_workflow\', \'edit_workflow\'), \'Property Type Validity Constraint\': (\'dynamic_class_generation_interaction_workflow\',), \'Property Existence Constraint\': (\'dynamic_class_generation_interaction_workflow\',), \'Action Information\': (\'base_type_interaction_workflow\',), \'ERP5Workflow Test Document\': (\'testing_workflow\', \'testing_interaction_workflow\', \'edit_workflow\'), \'Document\': (\'edit_workflow\',), \'Email\': (\'edit_workflow\',), \'Career\': (\'career_workflow\',), \'Document Component\': (\'edit_workflow\', \'dynamic_class_generation_interaction_workflow\', \'component_validation_workflow\'), \'Category Acquired Membership State Constraint\': (\'dynamic_class_generation_interaction_workflow\',), \'Predicate\': (\'rule_interaction_workflow\', \'edit_workflow\'), \'Category Tool\': (\'dynamic_class_generation_interaction_workflow\',), \'Attribute Unicity Constraint\': (\'dynamic_class_generation_interaction_workflow\',), \'Role Definition\': (\'edit_workflow\', \'local_permission_interaction_workflow\'), \'Category Membership State Constraint\': (\'dynamic_class_generation_interaction_workflow\',), \'Assignment\': (\'edit_workflow\', \'assignment_workflow\'), \'Distributed Ram Cache\': (\'distributed_ram_cache_interaction_workflow\',), \'Rounding Model\': (\'validation_workflow\',), \'Component\': (\'validation_workflow\', \'edit_workflow\'), \'Configuration Save\': (\'edit_workflow\',), \'Link\': (\'edit_workflow\',), \'Preference\': (\'edit_workflow\', \'preference_workflow\'), \'Address\': (\'edit_workflow\',), \'TALES Constraint\': (\'dynamic_class_generation_interaction_workflow\',), \'Category Property\': (\'dynamic_class_generation_interaction_workflow\',), \'Category Related Membership Arity Constraint\': (\'dynamic_class_generation_interaction_workflow\',), \'Content Existence Constraint\': (\'dynamic_class_generation_interaction_workflow\',), \'Notification Message\': (\'document_security_interaction_workflow\', \'notification_message_workflow\', \'processing_status_workflow\', \'document_conversion_interaction_workflow\', \'edit_workflow\'), \'Acquired Property\': (\'dynamic_class_generation_interaction_workflow\',), \'Property Sheet\': (\'dynamic_class_generation_interaction_workflow\',), \'Embedded File\': (\'edit_workflow\', \'embedded_workflow\', \'document_conversion_interaction_workflow\'), \'Category Membership Arity Constraint\': (\'dynamic_class_generation_interaction_workflow\',), \'Category Related Membership State Constraint\': (\'dynamic_class_generation_interaction_workflow\',), \'Alarm\': (\'edit_workflow\',), \'Bank Account\': (\'validation_workflow\', \'edit_workflow\'), \'Fax\': (\'edit_workflow\',), \'Mapped Value\': (\'edit_workflow\',), \'Business Template\': (\'business_template_building_workflow\', \'business_template_installation_workflow\'), \'Memcached Plugin\': (\'memcached_plugin_interaction_workflow\',), \'Attribute Blacklisted Constraint\': (\'dynamic_class_generation_interaction_workflow\',), \'Category Existence Constraint\': (\'dynamic_class_generation_interaction_workflow\',), \'Query\': (\'edit_workflow\', \'query_workflow\'), \'Attribute Equality Constraint\': (\'dynamic_class_generation_interaction_workflow\',), \'Simulation Movement\': (\'simulation_movement_causality_interaction_workflow\',), \'Person\': (\'validation_workflow\', \'edit_workflow\', \'person_interaction_workflow\', \'user_account_workflow\'), \'File\': (\'document_security_interaction_workflow\', \'document_conversion_interaction_workflow\', \'edit_workflow\'), \'Glossary Term\': (\'validation_workflow\', \'edit_workflow\'), \'Telephone\': (\'edit_workflow\',), \'Agent\': (\'edit_workflow\',), \'Bug\': (\'edit_workflow\', \'bug_workflow\'), \'String Attribute Match Constraint\': (\'dynamic_class_generation_interaction_workflow\',), \'Currency\': (\'validation_workflow\', \'edit_workflow\'), \'Base Type\': (\'dynamic_class_generation_interaction_workflow\', \'base_type_interaction_workflow\'), \'Extension Component\': (\'edit_workflow\', \'dynamic_class_generation_interaction_workflow\', \'component_validation_workflow\'), \'Chat Address\': (\'edit_workflow\',), \'Credit Card\': (\'validation_workflow\', \'edit_workflow\'), \'Currency Exchange Line\': (\'currency_exchange_line_interaction_workflow\', \'edit_workflow\', \'validation_workflow\'), \'Business Configuration\': (\'validation_workflow\', \'edit_workflow\', \'business_configuration_simulation_workflow\'), \'Standard Property\': (\'dynamic_class_generation_interaction_workflow\',), \'Image\': (\'document_security_interaction_workflow\', \'document_conversion_interaction_workflow\', \'edit_workflow\'), \'Property Sheet Tool\': (\'dynamic_class_generation_interaction_workflow\',)} \n
chains_by_type = context.getChainsByType()\n
\n
# the workflow_id to repair\n
......@@ -80,7 +80,7 @@ for workflow_id in workflow_id_to_repair_list:\n
</item>
<item>
<key> <string>id</string> </key>
<value> <string>chains_by_type_repair_script</string> </value>
<value> <string>repair_cbt</string> </value>
</item>
<item>
<key> <string>title</string> </key>
......
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