From 1b1ca1283d46d5bcb49892fc2d2586e36e3f44ea Mon Sep 17 00:00:00 2001
From: Jean-Paul Smets <jp@nexedi.com>
Date: Sat, 23 May 2009 17:11:38 +0000
Subject: [PATCH] Added support for trade condition type.

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@27135 20353a03-c40f-0410-a6d1-a30d3c3de9de
---
 .../trade_condition_type.xml                  | 110 ++++++++++++++++++
 .../erp5_trade/Base_viewTradeFieldLibrary.xml |  21 ++++
 .../PurchaseTradeCondition_view.xml           |   1 +
 .../my_trade_condition_type.xml               |  99 ++++++++++++++++
 .../erp5_trade/SaleTradeCondition_view.xml    |   1 +
 .../my_trade_condition_type.xml               |  99 ++++++++++++++++
 bt5/erp5_trade/bt/revision                    |   2 +-
 bt5/erp5_trade/bt/template_base_category_list |   1 +
 bt5/erp5_trade/bt/template_local_role_list    |   0
 .../bt/template_portal_type_role_list         |   0
 10 files changed, 333 insertions(+), 1 deletion(-)
 create mode 100644 bt5/erp5_trade/CategoryTemplateItem/portal_categories/trade_condition_type.xml
 create mode 100644 bt5/erp5_trade/SkinTemplateItem/portal_skins/erp5_trade/PurchaseTradeCondition_view/my_trade_condition_type.xml
 create mode 100644 bt5/erp5_trade/SkinTemplateItem/portal_skins/erp5_trade/SaleTradeCondition_view/my_trade_condition_type.xml
 create mode 100644 bt5/erp5_trade/bt/template_local_role_list
 create mode 100644 bt5/erp5_trade/bt/template_portal_type_role_list

diff --git a/bt5/erp5_trade/CategoryTemplateItem/portal_categories/trade_condition_type.xml b/bt5/erp5_trade/CategoryTemplateItem/portal_categories/trade_condition_type.xml
new file mode 100644
index 0000000000..b780e721d7
--- /dev/null
+++ b/bt5/erp5_trade/CategoryTemplateItem/portal_categories/trade_condition_type.xml
@@ -0,0 +1,110 @@
+<?xml version="1.0"?>
+<ZopeData>
+  <record id="1" aka="AAAAAAAAAAE=">
+    <pickle>
+      <tuple>
+        <global name="BaseCategory" module="Products.ERP5Type.Document.BaseCategory"/>
+        <tuple/>
+      </tuple>
+    </pickle>
+    <pickle>
+      <dictionary>
+        <item>
+            <key> <string>_Add_portal_content_Permission</string> </key>
+            <value>
+              <tuple>
+                <string>Assignor</string>
+                <string>Manager</string>
+              </tuple>
+            </value>
+        </item>
+        <item>
+            <key> <string>_Add_portal_folders_Permission</string> </key>
+            <value>
+              <tuple>
+                <string>Assignor</string>
+                <string>Manager</string>
+              </tuple>
+            </value>
+        </item>
+        <item>
+            <key> <string>_Copy_or_Move_Permission</string> </key>
+            <value>
+              <tuple>
+                <string>Assignor</string>
+                <string>Manager</string>
+              </tuple>
+            </value>
+        </item>
+        <item>
+            <key> <string>_count</string> </key>
+            <value>
+              <persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
+            </value>
+        </item>
+        <item>
+            <key> <string>_mt_index</string> </key>
+            <value>
+              <persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent>
+            </value>
+        </item>
+        <item>
+            <key> <string>_tree</string> </key>
+            <value>
+              <persistent> <string encoding="base64">AAAAAAAAAAQ=</string> </persistent>
+            </value>
+        </item>
+        <item>
+            <key> <string>categories</string> </key>
+            <value>
+              <tuple>
+                <string>trade_condition_type</string>
+              </tuple>
+            </value>
+        </item>
+        <item>
+            <key> <string>description</string> </key>
+            <value> <string>Trade Conditions can inherit each other. By using a trade condition type category, it is possible to implement different levels of security and sort trade conditions based on their intention (ex. legal, frame contract, distribution contract, etc.)</string> </value>
+        </item>
+        <item>
+            <key> <string>id</string> </key>
+            <value> <string>trade_condition_type</string> </value>
+        </item>
+        <item>
+            <key> <string>last_id</string> </key>
+            <value> <string>4</string> </value>
+        </item>
+        <item>
+            <key> <string>portal_type</string> </key>
+            <value> <string>Base Category</string> </value>
+        </item>
+        <item>
+            <key> <string>title</string> </key>
+            <value> <string>Trade Condition Type</string> </value>
+        </item>
+      </dictionary>
+    </pickle>
+  </record>
+  <record id="2" aka="AAAAAAAAAAI=">
+    <pickle>
+      <global name="Length" module="BTrees.Length"/>
+    </pickle>
+    <pickle> <int>0</int> </pickle>
+  </record>
+  <record id="3" aka="AAAAAAAAAAM=">
+    <pickle>
+      <global name="OOBTree" module="BTrees._OOBTree"/>
+    </pickle>
+    <pickle>
+      <none/>
+    </pickle>
+  </record>
+  <record id="4" aka="AAAAAAAAAAQ=">
+    <pickle>
+      <global name="OOBTree" module="BTrees._OOBTree"/>
+    </pickle>
+    <pickle>
+      <none/>
+    </pickle>
+  </record>
+</ZopeData>
diff --git a/bt5/erp5_trade/SkinTemplateItem/portal_skins/erp5_trade/Base_viewTradeFieldLibrary.xml b/bt5/erp5_trade/SkinTemplateItem/portal_skins/erp5_trade/Base_viewTradeFieldLibrary.xml
index 67379f9389..e571ff8773 100644
--- a/bt5/erp5_trade/SkinTemplateItem/portal_skins/erp5_trade/Base_viewTradeFieldLibrary.xml
+++ b/bt5/erp5_trade/SkinTemplateItem/portal_skins/erp5_trade/Base_viewTradeFieldLibrary.xml
@@ -9,6 +9,27 @@
     </pickle>
     <pickle>
       <dictionary>
+        <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/>
+                        </value>
+                    </item>
+                  </dictionary>
+                </state>
+              </object>
+            </value>
+        </item>
         <item>
             <key> <string>_objects</string> </key>
             <value>
diff --git a/bt5/erp5_trade/SkinTemplateItem/portal_skins/erp5_trade/PurchaseTradeCondition_view.xml b/bt5/erp5_trade/SkinTemplateItem/portal_skins/erp5_trade/PurchaseTradeCondition_view.xml
index b488a6b306..28954209be 100644
--- a/bt5/erp5_trade/SkinTemplateItem/portal_skins/erp5_trade/PurchaseTradeCondition_view.xml
+++ b/bt5/erp5_trade/SkinTemplateItem/portal_skins/erp5_trade/PurchaseTradeCondition_view.xml
@@ -108,6 +108,7 @@
                     <key> <string>right</string> </key>
                     <value>
                       <list>
+                        <string>my_trade_condition_type</string>
                         <string>my_source_section_title</string>
                         <string>my_source_title</string>
                         <string>my_source_decision_title</string>
diff --git a/bt5/erp5_trade/SkinTemplateItem/portal_skins/erp5_trade/PurchaseTradeCondition_view/my_trade_condition_type.xml b/bt5/erp5_trade/SkinTemplateItem/portal_skins/erp5_trade/PurchaseTradeCondition_view/my_trade_condition_type.xml
new file mode 100644
index 0000000000..02aecd6e69
--- /dev/null
+++ b/bt5/erp5_trade/SkinTemplateItem/portal_skins/erp5_trade/PurchaseTradeCondition_view/my_trade_condition_type.xml
@@ -0,0 +1,99 @@
+<?xml version="1.0"?>
+<ZopeData>
+  <record id="1" aka="AAAAAAAAAAE=">
+    <pickle>
+      <tuple>
+        <global name="ProxyField" module="Products.ERP5Form.ProxyField"/>
+        <tuple/>
+      </tuple>
+    </pickle>
+    <pickle>
+      <dictionary>
+        <item>
+            <key> <string>delegated_list</string> </key>
+            <value>
+              <list>
+                <string>title</string>
+              </list>
+            </value>
+        </item>
+        <item>
+            <key> <string>id</string> </key>
+            <value> <string>my_trade_condition_type</string> </value>
+        </item>
+        <item>
+            <key> <string>message_values</string> </key>
+            <value>
+              <dictionary>
+                <item>
+                    <key> <string>external_validator_failed</string> </key>
+                    <value> <string>The input failed the external validator.</string> </value>
+                </item>
+              </dictionary>
+            </value>
+        </item>
+        <item>
+            <key> <string>overrides</string> </key>
+            <value>
+              <dictionary>
+                <item>
+                    <key> <string>field_id</string> </key>
+                    <value> <string></string> </value>
+                </item>
+                <item>
+                    <key> <string>form_id</string> </key>
+                    <value> <string></string> </value>
+                </item>
+                <item>
+                    <key> <string>target</string> </key>
+                    <value> <string></string> </value>
+                </item>
+              </dictionary>
+            </value>
+        </item>
+        <item>
+            <key> <string>tales</string> </key>
+            <value>
+              <dictionary>
+                <item>
+                    <key> <string>field_id</string> </key>
+                    <value> <string></string> </value>
+                </item>
+                <item>
+                    <key> <string>form_id</string> </key>
+                    <value> <string></string> </value>
+                </item>
+                <item>
+                    <key> <string>target</string> </key>
+                    <value> <string></string> </value>
+                </item>
+              </dictionary>
+            </value>
+        </item>
+        <item>
+            <key> <string>values</string> </key>
+            <value>
+              <dictionary>
+                <item>
+                    <key> <string>field_id</string> </key>
+                    <value> <string>my_category</string> </value>
+                </item>
+                <item>
+                    <key> <string>form_id</string> </key>
+                    <value> <string>Base_viewTradeFieldLibrary</string> </value>
+                </item>
+                <item>
+                    <key> <string>target</string> </key>
+                    <value> <string>Click to edit the target</string> </value>
+                </item>
+                <item>
+                    <key> <string>title</string> </key>
+                    <value> <string>Trade Condition Type</string> </value>
+                </item>
+              </dictionary>
+            </value>
+        </item>
+      </dictionary>
+    </pickle>
+  </record>
+</ZopeData>
diff --git a/bt5/erp5_trade/SkinTemplateItem/portal_skins/erp5_trade/SaleTradeCondition_view.xml b/bt5/erp5_trade/SkinTemplateItem/portal_skins/erp5_trade/SaleTradeCondition_view.xml
index c2ec41a388..fde0df08bc 100644
--- a/bt5/erp5_trade/SkinTemplateItem/portal_skins/erp5_trade/SaleTradeCondition_view.xml
+++ b/bt5/erp5_trade/SkinTemplateItem/portal_skins/erp5_trade/SaleTradeCondition_view.xml
@@ -108,6 +108,7 @@
                     <key> <string>right</string> </key>
                     <value>
                       <list>
+                        <string>my_trade_condition_type</string>
                         <string>my_destination_section_title</string>
                         <string>my_destination_title</string>
                         <string>my_destination_decision_title</string>
diff --git a/bt5/erp5_trade/SkinTemplateItem/portal_skins/erp5_trade/SaleTradeCondition_view/my_trade_condition_type.xml b/bt5/erp5_trade/SkinTemplateItem/portal_skins/erp5_trade/SaleTradeCondition_view/my_trade_condition_type.xml
new file mode 100644
index 0000000000..02aecd6e69
--- /dev/null
+++ b/bt5/erp5_trade/SkinTemplateItem/portal_skins/erp5_trade/SaleTradeCondition_view/my_trade_condition_type.xml
@@ -0,0 +1,99 @@
+<?xml version="1.0"?>
+<ZopeData>
+  <record id="1" aka="AAAAAAAAAAE=">
+    <pickle>
+      <tuple>
+        <global name="ProxyField" module="Products.ERP5Form.ProxyField"/>
+        <tuple/>
+      </tuple>
+    </pickle>
+    <pickle>
+      <dictionary>
+        <item>
+            <key> <string>delegated_list</string> </key>
+            <value>
+              <list>
+                <string>title</string>
+              </list>
+            </value>
+        </item>
+        <item>
+            <key> <string>id</string> </key>
+            <value> <string>my_trade_condition_type</string> </value>
+        </item>
+        <item>
+            <key> <string>message_values</string> </key>
+            <value>
+              <dictionary>
+                <item>
+                    <key> <string>external_validator_failed</string> </key>
+                    <value> <string>The input failed the external validator.</string> </value>
+                </item>
+              </dictionary>
+            </value>
+        </item>
+        <item>
+            <key> <string>overrides</string> </key>
+            <value>
+              <dictionary>
+                <item>
+                    <key> <string>field_id</string> </key>
+                    <value> <string></string> </value>
+                </item>
+                <item>
+                    <key> <string>form_id</string> </key>
+                    <value> <string></string> </value>
+                </item>
+                <item>
+                    <key> <string>target</string> </key>
+                    <value> <string></string> </value>
+                </item>
+              </dictionary>
+            </value>
+        </item>
+        <item>
+            <key> <string>tales</string> </key>
+            <value>
+              <dictionary>
+                <item>
+                    <key> <string>field_id</string> </key>
+                    <value> <string></string> </value>
+                </item>
+                <item>
+                    <key> <string>form_id</string> </key>
+                    <value> <string></string> </value>
+                </item>
+                <item>
+                    <key> <string>target</string> </key>
+                    <value> <string></string> </value>
+                </item>
+              </dictionary>
+            </value>
+        </item>
+        <item>
+            <key> <string>values</string> </key>
+            <value>
+              <dictionary>
+                <item>
+                    <key> <string>field_id</string> </key>
+                    <value> <string>my_category</string> </value>
+                </item>
+                <item>
+                    <key> <string>form_id</string> </key>
+                    <value> <string>Base_viewTradeFieldLibrary</string> </value>
+                </item>
+                <item>
+                    <key> <string>target</string> </key>
+                    <value> <string>Click to edit the target</string> </value>
+                </item>
+                <item>
+                    <key> <string>title</string> </key>
+                    <value> <string>Trade Condition Type</string> </value>
+                </item>
+              </dictionary>
+            </value>
+        </item>
+      </dictionary>
+    </pickle>
+  </record>
+</ZopeData>
diff --git a/bt5/erp5_trade/bt/revision b/bt5/erp5_trade/bt/revision
index f874bfc9fc..d02412a497 100644
--- a/bt5/erp5_trade/bt/revision
+++ b/bt5/erp5_trade/bt/revision
@@ -1 +1 @@
-651
\ No newline at end of file
+655
\ No newline at end of file
diff --git a/bt5/erp5_trade/bt/template_base_category_list b/bt5/erp5_trade/bt/template_base_category_list
index 662c75d4f7..c1ee21d9bc 100644
--- a/bt5/erp5_trade/bt/template_base_category_list
+++ b/bt5/erp5_trade/bt/template_base_category_list
@@ -5,4 +5,5 @@ delivery_mode
 discount_type
 incoterm
 segmentation
+trade_condition_type
 trade_date
\ No newline at end of file
diff --git a/bt5/erp5_trade/bt/template_local_role_list b/bt5/erp5_trade/bt/template_local_role_list
new file mode 100644
index 0000000000..e69de29bb2
diff --git a/bt5/erp5_trade/bt/template_portal_type_role_list b/bt5/erp5_trade/bt/template_portal_type_role_list
new file mode 100644
index 0000000000..e69de29bb2
-- 
2.30.9