From 6c53d1546f844912fe5e919b708d04fb757b255f Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?J=C3=A9rome=20Perrin?= <jerome@nexedi.com>
Date: Fri, 25 Feb 2011 09:09:41 +0000
Subject: [PATCH] move Accounting Transaction Balance Constraint from erp5_core

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@43718 20353a03-c40f-0410-a6d1-a30d3c3de9de
---
 .../predicate.xml                             |  85 ++++++++++++
 .../view.xml                                  |  85 ++++++++++++
 .../allowed_content_types.xml                 |   1 +
 ...g%20Transaction%20Balance%20Constraint.xml | 125 ++++++++++++++++++
 .../workflow_chain_type.xml                   |   4 +
 bt5/erp5_accounting/bt/revision               |   2 +-
 .../bt/template_action_path_list              |   2 +
 ...late_portal_type_allowed_content_type_list |   1 +
 .../bt/template_portal_type_id_list           |   1 +
 .../template_portal_type_workflow_chain_list  |   1 +
 10 files changed, 306 insertions(+), 1 deletion(-)
 create mode 100644 bt5/erp5_accounting/ActionTemplateItem/portal_types/Accounting%20Transaction%20Balance%20Constraint/predicate.xml
 create mode 100644 bt5/erp5_accounting/ActionTemplateItem/portal_types/Accounting%20Transaction%20Balance%20Constraint/view.xml
 create mode 100644 bt5/erp5_accounting/PortalTypeTemplateItem/portal_types/Accounting%20Transaction%20Balance%20Constraint.xml

diff --git a/bt5/erp5_accounting/ActionTemplateItem/portal_types/Accounting%20Transaction%20Balance%20Constraint/predicate.xml b/bt5/erp5_accounting/ActionTemplateItem/portal_types/Accounting%20Transaction%20Balance%20Constraint/predicate.xml
new file mode 100644
index 0000000000..5b1933768b
--- /dev/null
+++ b/bt5/erp5_accounting/ActionTemplateItem/portal_types/Accounting%20Transaction%20Balance%20Constraint/predicate.xml
@@ -0,0 +1,85 @@
+<?xml version="1.0"?>
+<ZopeData>
+  <record id="1" aka="AAAAAAAAAAE=">
+    <pickle>
+      <global name="ActionInformation" module="Products.CMFCore.ActionInformation"/>
+    </pickle>
+    <pickle>
+      <dictionary>
+        <item>
+            <key> <string>action</string> </key>
+            <value>
+              <persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
+            </value>
+        </item>
+        <item>
+            <key> <string>categories</string> </key>
+            <value>
+              <tuple>
+                <string>action_type/object_view</string>
+              </tuple>
+            </value>
+        </item>
+        <item>
+            <key> <string>category</string> </key>
+            <value> <string>object_view</string> </value>
+        </item>
+        <item>
+            <key> <string>condition</string> </key>
+            <value> <string></string> </value>
+        </item>
+        <item>
+            <key> <string>description</string> </key>
+            <value>
+              <none/>
+            </value>
+        </item>
+        <item>
+            <key> <string>icon</string> </key>
+            <value> <string></string> </value>
+        </item>
+        <item>
+            <key> <string>id</string> </key>
+            <value> <string>predicate</string> </value>
+        </item>
+        <item>
+            <key> <string>permissions</string> </key>
+            <value>
+              <tuple>
+                <string>View</string>
+              </tuple>
+            </value>
+        </item>
+        <item>
+            <key> <string>portal_type</string> </key>
+            <value> <string>Action Information</string> </value>
+        </item>
+        <item>
+            <key> <string>priority</string> </key>
+            <value> <float>2.0</float> </value>
+        </item>
+        <item>
+            <key> <string>title</string> </key>
+            <value> <string>Predicate</string> </value>
+        </item>
+        <item>
+            <key> <string>visible</string> </key>
+            <value> <int>1</int> </value>
+        </item>
+      </dictionary>
+    </pickle>
+  </record>
+  <record id="2" aka="AAAAAAAAAAI=">
+    <pickle>
+      <global name="Expression" module="Products.CMFCore.Expression"/>
+    </pickle>
+    <pickle>
+      <dictionary>
+        <item>
+            <key> <string>text</string> </key>
+            <value> <string>string:${object_url}/Predicate_view</string> </value>
+        </item>
+      </dictionary>
+    </pickle>
+  </record>
+</ZopeData>
diff --git a/bt5/erp5_accounting/ActionTemplateItem/portal_types/Accounting%20Transaction%20Balance%20Constraint/view.xml b/bt5/erp5_accounting/ActionTemplateItem/portal_types/Accounting%20Transaction%20Balance%20Constraint/view.xml
new file mode 100644
index 0000000000..a04255899e
--- /dev/null
+++ b/bt5/erp5_accounting/ActionTemplateItem/portal_types/Accounting%20Transaction%20Balance%20Constraint/view.xml
@@ -0,0 +1,85 @@
+<?xml version="1.0"?>
+<ZopeData>
+  <record id="1" aka="AAAAAAAAAAE=">
+    <pickle>
+      <global name="ActionInformation" module="Products.CMFCore.ActionInformation"/>
+    </pickle>
+    <pickle>
+      <dictionary>
+        <item>
+            <key> <string>action</string> </key>
+            <value>
+              <persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
+            </value>
+        </item>
+        <item>
+            <key> <string>categories</string> </key>
+            <value>
+              <tuple>
+                <string>action_type/object_view</string>
+              </tuple>
+            </value>
+        </item>
+        <item>
+            <key> <string>category</string> </key>
+            <value> <string>object_view</string> </value>
+        </item>
+        <item>
+            <key> <string>condition</string> </key>
+            <value> <string></string> </value>
+        </item>
+        <item>
+            <key> <string>description</string> </key>
+            <value>
+              <none/>
+            </value>
+        </item>
+        <item>
+            <key> <string>icon</string> </key>
+            <value> <string></string> </value>
+        </item>
+        <item>
+            <key> <string>id</string> </key>
+            <value> <string>view</string> </value>
+        </item>
+        <item>
+            <key> <string>permissions</string> </key>
+            <value>
+              <tuple>
+                <string>View</string>
+              </tuple>
+            </value>
+        </item>
+        <item>
+            <key> <string>portal_type</string> </key>
+            <value> <string>Action Information</string> </value>
+        </item>
+        <item>
+            <key> <string>priority</string> </key>
+            <value> <float>1.0</float> </value>
+        </item>
+        <item>
+            <key> <string>title</string> </key>
+            <value> <string>View</string> </value>
+        </item>
+        <item>
+            <key> <string>visible</string> </key>
+            <value> <int>1</int> </value>
+        </item>
+      </dictionary>
+    </pickle>
+  </record>
+  <record id="2" aka="AAAAAAAAAAI=">
+    <pickle>
+      <global name="Expression" module="Products.CMFCore.Expression"/>
+    </pickle>
+    <pickle>
+      <dictionary>
+        <item>
+            <key> <string>text</string> </key>
+            <value> <string>string:${object_url}/AccountingTransactionBalanceConstraint_view</string> </value>
+        </item>
+      </dictionary>
+    </pickle>
+  </record>
+</ZopeData>
diff --git a/bt5/erp5_accounting/PortalTypeAllowedContentTypeTemplateItem/allowed_content_types.xml b/bt5/erp5_accounting/PortalTypeAllowedContentTypeTemplateItem/allowed_content_types.xml
index 99019b59ef..e5b1c6bb37 100644
--- a/bt5/erp5_accounting/PortalTypeAllowedContentTypeTemplateItem/allowed_content_types.xml
+++ b/bt5/erp5_accounting/PortalTypeAllowedContentTypeTemplateItem/allowed_content_types.xml
@@ -71,6 +71,7 @@
  </portal_type>
  <portal_type id="Property Sheet">
   <item>Account Type Constraint</item>
+  <item>Accounting Transaction Balance Constraint</item>
  </portal_type>
  <portal_type id="Purchase Invoice Transaction">
   <item>Embedded File</item>
diff --git a/bt5/erp5_accounting/PortalTypeTemplateItem/portal_types/Accounting%20Transaction%20Balance%20Constraint.xml b/bt5/erp5_accounting/PortalTypeTemplateItem/portal_types/Accounting%20Transaction%20Balance%20Constraint.xml
new file mode 100644
index 0000000000..cdd46c6cb2
--- /dev/null
+++ b/bt5/erp5_accounting/PortalTypeTemplateItem/portal_types/Accounting%20Transaction%20Balance%20Constraint.xml
@@ -0,0 +1,125 @@
+<?xml version="1.0"?>
+<ZopeData>
+  <record id="1" aka="AAAAAAAAAAE=">
+    <pickle>
+      <global name="Base Type" module="erp5.portal_type"/>
+    </pickle>
+    <pickle>
+      <dictionary>
+        <item>
+            <key> <string>_property_domain_dict</string> </key>
+            <value>
+              <dictionary>
+                <item>
+                    <key> <string>short_title</string> </key>
+                    <value>
+                      <persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
+                    </value>
+                </item>
+                <item>
+                    <key> <string>title</string> </key>
+                    <value>
+                      <persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent>
+                    </value>
+                </item>
+              </dictionary>
+            </value>
+        </item>
+        <item>
+            <key> <string>content_icon</string> </key>
+            <value>
+              <none/>
+            </value>
+        </item>
+        <item>
+            <key> <string>description</string> </key>
+            <value> <string>An Accounting Transaction Balance Constraint checks whether accounting transaction total debit and total credit are equal</string> </value>
+        </item>
+        <item>
+            <key> <string>group_list</string> </key>
+            <value>
+              <tuple>
+                <string>constraint</string>
+              </tuple>
+            </value>
+        </item>
+        <item>
+            <key> <string>id</string> </key>
+            <value> <string>Accounting Transaction Balance Constraint</string> </value>
+        </item>
+        <item>
+            <key> <string>init_script</string> </key>
+            <value>
+              <none/>
+            </value>
+        </item>
+        <item>
+            <key> <string>permission</string> </key>
+            <value>
+              <none/>
+            </value>
+        </item>
+        <item>
+            <key> <string>portal_type</string> </key>
+            <value> <string>Base Type</string> </value>
+        </item>
+        <item>
+            <key> <string>type_class</string> </key>
+            <value> <string>AccountingTransactionBalanceConstraint</string> </value>
+        </item>
+        <item>
+            <key> <string>type_interface</string> </key>
+            <value>
+              <tuple/>
+            </value>
+        </item>
+        <item>
+            <key> <string>type_mixin</string> </key>
+            <value>
+              <tuple/>
+            </value>
+        </item>
+        <item>
+            <key> <string>type_zodb_property_sheet_list</string> </key>
+            <value>
+              <tuple/>
+            </value>
+        </item>
+      </dictionary>
+    </pickle>
+  </record>
+  <record id="2" aka="AAAAAAAAAAI=">
+    <pickle>
+      <global name="TranslationInformation" module="Products.ERP5Type.TranslationProviderBase"/>
+    </pickle>
+    <pickle>
+      <dictionary>
+        <item>
+            <key> <string>domain_name</string> </key>
+            <value> <string>erp5_content</string> </value>
+        </item>
+        <item>
+            <key> <string>property_name</string> </key>
+            <value> <string>short_title</string> </value>
+        </item>
+      </dictionary>
+    </pickle>
+  </record>
+  <record id="3" aka="AAAAAAAAAAM=">
+    <pickle>
+      <global name="TranslationInformation" module="Products.ERP5Type.TranslationProviderBase"/>
+    </pickle>
+    <pickle>
+      <dictionary>
+        <item>
+            <key> <string>domain_name</string> </key>
+            <value> <string>erp5_content</string> </value>
+        </item>
+        <item>
+            <key> <string>property_name</string> </key>
+            <value> <string>title</string> </value>
+        </item>
+      </dictionary>
+    </pickle>
+  </record>
+</ZopeData>
diff --git a/bt5/erp5_accounting/PortalTypeWorkflowChainTemplateItem/workflow_chain_type.xml b/bt5/erp5_accounting/PortalTypeWorkflowChainTemplateItem/workflow_chain_type.xml
index 38814c08d7..e7828e0dc1 100644
--- a/bt5/erp5_accounting/PortalTypeWorkflowChainTemplateItem/workflow_chain_type.xml
+++ b/bt5/erp5_accounting/PortalTypeWorkflowChainTemplateItem/workflow_chain_type.xml
@@ -11,6 +11,10 @@
   <type>Accounting Transaction</type>
   <workflow>accounting_workflow, delivery_causality_interaction_workflow, delivery_causality_workflow, delivery_simulation_interaction_workflow, edit_workflow</workflow>
  </chain>
+ <chain>
+  <type>Accounting Transaction Balance Constraint</type>
+  <workflow>dynamic_class_generation_interaction_workflow</workflow>
+ </chain>
  <chain>
   <type>Accounting Transaction Line</type>
   <workflow>delivery_movement_causality_interaction_workflow, delivery_movement_simulation_interaction_workflow, edit_workflow</workflow>
diff --git a/bt5/erp5_accounting/bt/revision b/bt5/erp5_accounting/bt/revision
index a1788aa5b2..ce7224cd64 100644
--- a/bt5/erp5_accounting/bt/revision
+++ b/bt5/erp5_accounting/bt/revision
@@ -1 +1 @@
-1454
\ No newline at end of file
+1455
\ No newline at end of file
diff --git a/bt5/erp5_accounting/bt/template_action_path_list b/bt5/erp5_accounting/bt/template_action_path_list
index 20b658f3c1..afb7f120f8 100644
--- a/bt5/erp5_accounting/bt/template_action_path_list
+++ b/bt5/erp5_accounting/bt/template_action_path_list
@@ -13,6 +13,8 @@ Accounting Period | view
 Accounting Rule Cell Line | view
 Accounting Rule Cell | view
 Accounting Rule Cell | view_destination
+Accounting Transaction Balance Constraint | predicate
+Accounting Transaction Balance Constraint | view
 Accounting Transaction Line | destination_view
 Accounting Transaction Line | view
 Accounting Transaction Module | account_statement_export
diff --git a/bt5/erp5_accounting/bt/template_portal_type_allowed_content_type_list b/bt5/erp5_accounting/bt/template_portal_type_allowed_content_type_list
index 0c5bacdb1d..6ba994f11d 100644
--- a/bt5/erp5_accounting/bt/template_portal_type_allowed_content_type_list
+++ b/bt5/erp5_accounting/bt/template_portal_type_allowed_content_type_list
@@ -43,6 +43,7 @@ Preference | Payment Transaction
 Preference | Purchase Invoice Transaction
 Preference | Sale Invoice Transaction
 Property Sheet | Account Type Constraint
+Property Sheet | Accounting Transaction Balance Constraint
 Purchase Invoice Transaction | Embedded File
 Purchase Invoice Transaction | Purchase Invoice Transaction Line
 Rule Tool | Accounting Transaction Root Simulation Rule
diff --git a/bt5/erp5_accounting/bt/template_portal_type_id_list b/bt5/erp5_accounting/bt/template_portal_type_id_list
index 65ed1f8a51..49d552cd66 100644
--- a/bt5/erp5_accounting/bt/template_portal_type_id_list
+++ b/bt5/erp5_accounting/bt/template_portal_type_id_list
@@ -6,6 +6,7 @@ Accounting Period
 Accounting Rule Cell
 Accounting Rule Cell Line
 Accounting Transaction
+Accounting Transaction Balance Constraint
 Accounting Transaction Line
 Accounting Transaction Module
 Accounting Transaction Root Simulation Rule
diff --git a/bt5/erp5_accounting/bt/template_portal_type_workflow_chain_list b/bt5/erp5_accounting/bt/template_portal_type_workflow_chain_list
index 0f70785878..b7d8207349 100644
--- a/bt5/erp5_accounting/bt/template_portal_type_workflow_chain_list
+++ b/bt5/erp5_accounting/bt/template_portal_type_workflow_chain_list
@@ -2,6 +2,7 @@ Account | account_workflow
 Account | edit_workflow
 Accounting Period | accounting_period_workflow
 Accounting Period | edit_workflow
+Accounting Transaction Balance Constraint | dynamic_class_generation_interaction_workflow
 Accounting Transaction Line | delivery_movement_causality_interaction_workflow
 Accounting Transaction Line | delivery_movement_simulation_interaction_workflow
 Accounting Transaction Line | edit_workflow
-- 
2.30.9