From 847e4b2807569f18d8c4a6b00b131938fecc967d Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?J=C3=A9rome=20Perrin?= <jerome@nexedi.com>
Date: Mon, 16 Oct 2006 12:03:03 +0000
Subject: [PATCH] Allow accounts deletion.

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@10739 20353a03-c40f-0410-a6d1-a30d3c3de9de
---
 .../account_workflow/states/deleted.xml       | 101 ++++++++++++++++++
 .../account_workflow/states/draft.xml         |   8 ++
 .../account_workflow/states/invalidated.xml   |   8 ++
 .../account_workflow/transitions/delete.xml   |  70 ++++++++++++
 .../transitions/delete_action.xml             |  94 ++++++++++++++++
 bt5/erp5_accounting/bt/revision               |   2 +-
 6 files changed, 282 insertions(+), 1 deletion(-)
 create mode 100644 bt5/erp5_accounting/WorkflowTemplateItem/portal_workflow/account_workflow/states/deleted.xml
 create mode 100644 bt5/erp5_accounting/WorkflowTemplateItem/portal_workflow/account_workflow/transitions/delete.xml
 create mode 100644 bt5/erp5_accounting/WorkflowTemplateItem/portal_workflow/account_workflow/transitions/delete_action.xml

diff --git a/bt5/erp5_accounting/WorkflowTemplateItem/portal_workflow/account_workflow/states/deleted.xml b/bt5/erp5_accounting/WorkflowTemplateItem/portal_workflow/account_workflow/states/deleted.xml
new file mode 100644
index 0000000000..0a23f3f67b
--- /dev/null
+++ b/bt5/erp5_accounting/WorkflowTemplateItem/portal_workflow/account_workflow/states/deleted.xml
@@ -0,0 +1,101 @@
+<?xml version="1.0"?>
+<ZopeData>
+  <record id="1" aka="AAAAAAAAAAE=">
+    <pickle>
+      <tuple>
+        <tuple>
+          <string>Products.DCWorkflow.States</string>
+          <string>StateDefinition</string>
+        </tuple>
+        <none/>
+      </tuple>
+    </pickle>
+    <pickle>
+      <dictionary>
+        <item>
+            <key> <string>__ac_local_roles__</string> </key>
+            <value>
+              <none/>
+            </value>
+        </item>
+        <item>
+            <key> <string>description</string> </key>
+            <value> <string></string> </value>
+        </item>
+        <item>
+            <key> <string>id</string> </key>
+            <value> <string>deleted</string> </value>
+        </item>
+        <item>
+            <key> <string>permission_roles</string> </key>
+            <value>
+              <persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
+            </value>
+        </item>
+        <item>
+            <key> <string>title</string> </key>
+            <value> <string>Deleted</string> </value>
+        </item>
+        <item>
+            <key> <string>transitions</string> </key>
+            <value>
+              <tuple/>
+            </value>
+        </item>
+        <item>
+            <key> <string>type_list</string> </key>
+            <value>
+              <tuple/>
+            </value>
+        </item>
+      </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>
+                <item>
+                    <key> <string>Access contents information</string> </key>
+                    <value>
+                      <tuple>
+                        <string>Assignee</string>
+                        <string>Assignor</string>
+                        <string>Auditor</string>
+                        <string>Manager</string>
+                      </tuple>
+                    </value>
+                </item>
+                <item>
+                    <key> <string>Modify portal content</string> </key>
+                    <value>
+                      <tuple/>
+                    </value>
+                </item>
+                <item>
+                    <key> <string>View</string> </key>
+                    <value>
+                      <tuple>
+                        <string>Manager</string>
+                      </tuple>
+                    </value>
+                </item>
+              </dictionary>
+            </value>
+        </item>
+      </dictionary>
+    </pickle>
+  </record>
+</ZopeData>
diff --git a/bt5/erp5_accounting/WorkflowTemplateItem/portal_workflow/account_workflow/states/draft.xml b/bt5/erp5_accounting/WorkflowTemplateItem/portal_workflow/account_workflow/states/draft.xml
index 20361e6501..b2c75ab02d 100644
--- a/bt5/erp5_accounting/WorkflowTemplateItem/portal_workflow/account_workflow/states/draft.xml
+++ b/bt5/erp5_accounting/WorkflowTemplateItem/portal_workflow/account_workflow/states/draft.xml
@@ -40,11 +40,19 @@
             <key> <string>transitions</string> </key>
             <value>
               <tuple>
+                <string>delete</string>
+                <string>delete_action</string>
                 <string>validate</string>
                 <string>validate_action</string>
               </tuple>
             </value>
         </item>
+        <item>
+            <key> <string>type_list</string> </key>
+            <value>
+              <tuple/>
+            </value>
+        </item>
         <item>
             <key> <string>uid</string> </key>
             <value>
diff --git a/bt5/erp5_accounting/WorkflowTemplateItem/portal_workflow/account_workflow/states/invalidated.xml b/bt5/erp5_accounting/WorkflowTemplateItem/portal_workflow/account_workflow/states/invalidated.xml
index a28bce1be8..a2364c66a8 100644
--- a/bt5/erp5_accounting/WorkflowTemplateItem/portal_workflow/account_workflow/states/invalidated.xml
+++ b/bt5/erp5_accounting/WorkflowTemplateItem/portal_workflow/account_workflow/states/invalidated.xml
@@ -40,11 +40,19 @@
             <key> <string>transitions</string> </key>
             <value>
               <tuple>
+                <string>delete</string>
+                <string>delete_action</string>
                 <string>validate</string>
                 <string>validate_action</string>
               </tuple>
             </value>
         </item>
+        <item>
+            <key> <string>type_list</string> </key>
+            <value>
+              <tuple/>
+            </value>
+        </item>
       </dictionary>
     </pickle>
   </record>
diff --git a/bt5/erp5_accounting/WorkflowTemplateItem/portal_workflow/account_workflow/transitions/delete.xml b/bt5/erp5_accounting/WorkflowTemplateItem/portal_workflow/account_workflow/transitions/delete.xml
new file mode 100644
index 0000000000..2659ed2cfa
--- /dev/null
+++ b/bt5/erp5_accounting/WorkflowTemplateItem/portal_workflow/account_workflow/transitions/delete.xml
@@ -0,0 +1,70 @@
+<?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>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>
+              <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></string> </value>
+        </item>
+        <item>
+            <key> <string>trigger_type</string> </key>
+            <value> <int>2</int> </value>
+        </item>
+      </dictionary>
+    </pickle>
+  </record>
+</ZopeData>
diff --git a/bt5/erp5_accounting/WorkflowTemplateItem/portal_workflow/account_workflow/transitions/delete_action.xml b/bt5/erp5_accounting/WorkflowTemplateItem/portal_workflow/account_workflow/transitions/delete_action.xml
new file mode 100644
index 0000000000..362063e778
--- /dev/null
+++ b/bt5/erp5_accounting/WorkflowTemplateItem/portal_workflow/account_workflow/transitions/delete_action.xml
@@ -0,0 +1,94 @@
+<?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>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>delete</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>delete_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></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>Assignor</string>
+              </tuple>
+            </value>
+        </item>
+      </dictionary>
+    </pickle>
+  </record>
+</ZopeData>
diff --git a/bt5/erp5_accounting/bt/revision b/bt5/erp5_accounting/bt/revision
index 24af08a487..615be700b9 100644
--- a/bt5/erp5_accounting/bt/revision
+++ b/bt5/erp5_accounting/bt/revision
@@ -1 +1 @@
-83
\ No newline at end of file
+85
\ No newline at end of file
-- 
2.30.9