From d8a75c08aa7bfe3e6637659b7b5e95dcb3427571 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?J=C3=A9rome=20Perrin?= <jerome@nexedi.com>
Date: Wed, 26 Apr 2006 07:50:31 +0000
Subject: [PATCH] Fix allowed content types for Rule Tool (Order & Delivery
 Rule from erp5_trade, Invoice, Invoicing & Payment from erp5_accounting)

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@6927 20353a03-c40f-0410-a6d1-a30d3c3de9de
---
 .../allowed_content_types.xml                 |  6 ++
 .../portal_types/Payment%20Rule.xml           | 98 +++++++++++++++++++
 ...late_portal_type_allowed_content_type_list |  4 +
 .../bt/template_portal_type_id_list           |  1 +
 .../allowed_content_types.xml                 |  4 +
 ...late_portal_type_allowed_content_type_list |  2 +
 .../portal_types/Rule%20Tool.xml              | 19 +++-
 7 files changed, 129 insertions(+), 5 deletions(-)
 create mode 100644 bt5/erp5_accounting/PortalTypeTemplateItem/portal_types/Payment%20Rule.xml

diff --git a/bt5/erp5_accounting/PortalTypeAllowedContentTypeTemplateItem/allowed_content_types.xml b/bt5/erp5_accounting/PortalTypeAllowedContentTypeTemplateItem/allowed_content_types.xml
index b14ae37abd..0c804dd03d 100644
--- a/bt5/erp5_accounting/PortalTypeAllowedContentTypeTemplateItem/allowed_content_types.xml
+++ b/bt5/erp5_accounting/PortalTypeAllowedContentTypeTemplateItem/allowed_content_types.xml
@@ -46,6 +46,12 @@
   <item>Trade Condition</item>
   <item>Invoice Line</item>
  </portal_type>
+ <portal_type id="Rule Tool">
+  <item>Invoice Rule</item>
+  <item>Invoice Transaction Rule</item>
+  <item>Invoicing Rule</item>
+  <item>Payment Rule</item>
+ </portal_type>
  <portal_type id="Sale Invoice Transaction">
   <item>Sale Invoice Transaction Line</item>
   <item>Trade Condition</item>
diff --git a/bt5/erp5_accounting/PortalTypeTemplateItem/portal_types/Payment%20Rule.xml b/bt5/erp5_accounting/PortalTypeTemplateItem/portal_types/Payment%20Rule.xml
new file mode 100644
index 0000000000..9531da693e
--- /dev/null
+++ b/bt5/erp5_accounting/PortalTypeTemplateItem/portal_types/Payment%20Rule.xml
@@ -0,0 +1,98 @@
+<?xml version="1.0"?>
+<ZopeData>
+  <record id="1" aka="AAAAAAAAAAE=">
+    <pickle>
+      <tuple>
+        <tuple>
+          <string>Products.ERP5Type.ERP5Type</string>
+          <string>ERP5TypeInformation</string>
+        </tuple>
+        <none/>
+      </tuple>
+    </pickle>
+    <pickle>
+      <dictionary>
+        <item>
+            <key> <string>__ac_local_roles__</string> </key>
+            <value>
+              <none/>
+            </value>
+        </item>
+        <item>
+            <key> <string>_actions</string> </key>
+            <value>
+              <tuple/>
+            </value>
+        </item>
+        <item>
+            <key> <string>_owner</string> </key>
+            <value>
+              <none/>
+            </value>
+        </item>
+        <item>
+            <key> <string>_roles</string> </key>
+            <value>
+              <list/>
+            </value>
+        </item>
+        <item>
+            <key> <string>allowed_content_types</string> </key>
+            <value>
+              <tuple/>
+            </value>
+        </item>
+        <item>
+            <key> <string>base_category_list</string> </key>
+            <value>
+              <tuple/>
+            </value>
+        </item>
+        <item>
+            <key> <string>content_icon</string> </key>
+            <value> <string>document.gif</string> </value>
+        </item>
+        <item>
+            <key> <string>content_meta_type</string> </key>
+            <value> <string>ERP5 Payment Rule</string> </value>
+        </item>
+        <item>
+            <key> <string>description</string> </key>
+            <value> <string>      Payment Rule generates payment simulation movement from invoice transaction simulation movements.</string> </value>
+        </item>
+        <item>
+            <key> <string>factory</string> </key>
+            <value> <string>addPaymentRule</string> </value>
+        </item>
+        <item>
+            <key> <string>filter_content_types</string> </key>
+            <value> <int>1</int> </value>
+        </item>
+        <item>
+            <key> <string>hidden_content_type_list</string> </key>
+            <value>
+              <tuple/>
+            </value>
+        </item>
+        <item>
+            <key> <string>id</string> </key>
+            <value> <string>Payment Rule</string> </value>
+        </item>
+        <item>
+            <key> <string>init_script</string> </key>
+            <value> <string></string> </value>
+        </item>
+        <item>
+            <key> <string>property_sheet_list</string> </key>
+            <value>
+              <tuple/>
+            </value>
+        </item>
+        <item>
+            <key> <string>title</string> </key>
+            <value> <string></string> </value>
+        </item>
+      </dictionary>
+    </pickle>
+  </record>
+</ZopeData>
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 3c262ab97b..a02d121239 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
@@ -21,6 +21,10 @@ Preference | Sale Invoice Transaction
 Purchase Invoice Transaction | Invoice Line
 Purchase Invoice Transaction | Purchase Invoice Transaction Line
 Purchase Invoice Transaction | Trade Condition
+Rule Tool | Invoice Rule
+Rule Tool | Invoice Transaction Rule
+Rule Tool | Invoicing Rule
+Rule Tool | Payment Rule
 Sale Invoice Transaction | Invoice Line
 Sale Invoice Transaction | Sale Invoice Transaction Line
 Sale Invoice Transaction | Trade Condition
\ No newline at end of file
diff --git a/bt5/erp5_accounting/bt/template_portal_type_id_list b/bt5/erp5_accounting/bt/template_portal_type_id_list
index 734db093c2..f8a49eefe0 100644
--- a/bt5/erp5_accounting/bt/template_portal_type_id_list
+++ b/bt5/erp5_accounting/bt/template_portal_type_id_list
@@ -13,6 +13,7 @@ Invoice Line
 Invoice Rule
 Invoice Transaction Rule
 Invoicing Rule
+Payment Rule
 Payment Transaction
 Purchase Invoice Transaction
 Purchase Invoice Transaction Line
diff --git a/bt5/erp5_trade/PortalTypeAllowedContentTypeTemplateItem/allowed_content_types.xml b/bt5/erp5_trade/PortalTypeAllowedContentTypeTemplateItem/allowed_content_types.xml
index fe8c04f5e9..5b28d18774 100644
--- a/bt5/erp5_trade/PortalTypeAllowedContentTypeTemplateItem/allowed_content_types.xml
+++ b/bt5/erp5_trade/PortalTypeAllowedContentTypeTemplateItem/allowed_content_types.xml
@@ -71,6 +71,10 @@
  <portal_type id="Returned Sale Packing List Module">
   <item>Returned Sale Packing List</item>
  </portal_type>
+ <portal_type id="Rule Tool">
+  <item>Order Rule</item>
+  <item>Delivery Rule</item>
+ </portal_type>
  <portal_type id="Sale Order">
   <item>Sale Order Line</item>
   <item>Discount</item>
diff --git a/bt5/erp5_trade/bt/template_portal_type_allowed_content_type_list b/bt5/erp5_trade/bt/template_portal_type_allowed_content_type_list
index a116f2de93..ce7ea4487e 100644
--- a/bt5/erp5_trade/bt/template_portal_type_allowed_content_type_list
+++ b/bt5/erp5_trade/bt/template_portal_type_allowed_content_type_list
@@ -26,6 +26,8 @@ Returned Sale Packing List Line | Returned Sale Packing List Cell
 Returned Sale Packing List Module | Returned Sale Packing List
 Returned Sale Packing List | Container
 Returned Sale Packing List | Returned Sale Packing List Line
+Rule Tool | Delivery Rule
+Rule Tool | Order Rule
 Sale Order Line | Delivery Cell
 Sale Order Module | Sale Order
 Sale Order | Discount
diff --git a/product/ERP5/bootstrap/erp5_core/PortalTypeTemplateItem/portal_types/Rule%20Tool.xml b/product/ERP5/bootstrap/erp5_core/PortalTypeTemplateItem/portal_types/Rule%20Tool.xml
index fa5c83bc4e..77f5f7307b 100644
--- a/product/ERP5/bootstrap/erp5_core/PortalTypeTemplateItem/portal_types/Rule%20Tool.xml
+++ b/product/ERP5/bootstrap/erp5_core/PortalTypeTemplateItem/portal_types/Rule%20Tool.xml
@@ -36,6 +36,10 @@
               <list/>
             </value>
         </item>
+        <item>
+            <key> <string>acquire_local_roles</string> </key>
+            <value> <int>1</int> </value>
+        </item>
         <item>
             <key> <string>allowed_content_types</string> </key>
             <value>
@@ -54,20 +58,25 @@
         </item>
         <item>
             <key> <string>content_meta_type</string> </key>
-            <value> <string>ERP5 Folder</string> </value>
+            <value> <string>ERP5 Rule Tool</string> </value>
         </item>
         <item>
             <key> <string>description</string> </key>
-            <value> <string>Folders allow to store a large number of documents (1,000,000 should not\n
-be a problem).</string> </value>
+            <value> <string>The RulesTool implements portal objects transformation policies.</string> </value>
         </item>
         <item>
             <key> <string>factory</string> </key>
-            <value> <string>addFolder</string> </value>
+            <value> <string></string> </value>
         </item>
         <item>
             <key> <string>filter_content_types</string> </key>
-            <value> <int>0</int> </value>
+            <value> <int>1</int> </value>
+        </item>
+        <item>
+            <key> <string>group_list</string> </key>
+            <value>
+              <tuple/>
+            </value>
         </item>
         <item>
             <key> <string>hidden_content_type_list</string> </key>
-- 
2.30.9