From e69ae9e71f471b0246e064de35a223b386ff7042 Mon Sep 17 00:00:00 2001
From: Fabien Morin <fabien@nexedi.com>
Date: Fri, 29 Jan 2010 17:40:31 +0000
Subject: [PATCH] use product_line instead of resource

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@32098 20353a03-c40f-0410-a6d1-a30d3c3de9de
---
 .../erp5_apparel/ApparelComponent_view.xml    |  2 +-
 .../{my_resource.xml => my_product_line.xml}  | 45 +--------
 .../erp5_apparel/ApparelFabric_view.xml       |  2 +-
 .../ApparelFabric_view/my_product_line.xml    | 93 +++++++++++++++++++
 .../Base_viewApparelFieldLibrary.xml          |  1 +
 .../my_product_line.xml}                      | 34 ++++---
 bt5/erp5_apparel/bt/revision                  |  2 +-
 7 files changed, 116 insertions(+), 63 deletions(-)
 rename bt5/erp5_apparel/SkinTemplateItem/portal_skins/erp5_apparel/ApparelComponent_view/{my_resource.xml => my_product_line.xml} (63%)
 create mode 100644 bt5/erp5_apparel/SkinTemplateItem/portal_skins/erp5_apparel/ApparelFabric_view/my_product_line.xml
 rename bt5/erp5_apparel/SkinTemplateItem/portal_skins/erp5_apparel/{ApparelFabric_view/my_resource.xml => Base_viewApparelFieldLibrary/my_product_line.xml} (83%)

diff --git a/bt5/erp5_apparel/SkinTemplateItem/portal_skins/erp5_apparel/ApparelComponent_view.xml b/bt5/erp5_apparel/SkinTemplateItem/portal_skins/erp5_apparel/ApparelComponent_view.xml
index 330e35d5c7..e43f643d20 100644
--- a/bt5/erp5_apparel/SkinTemplateItem/portal_skins/erp5_apparel/ApparelComponent_view.xml
+++ b/bt5/erp5_apparel/SkinTemplateItem/portal_skins/erp5_apparel/ApparelComponent_view.xml
@@ -95,7 +95,7 @@
                         <string>my_title</string>
                         <string>my_reference</string>
                         <string>my_purchase_supply_line_source_reference</string>
-                        <string>my_resource</string>
+                        <string>my_product_line</string>
                         <string>my_quantity_unit_list</string>
                         <string>my_trade_description</string>
                         <string>my_base_weight</string>
diff --git a/bt5/erp5_apparel/SkinTemplateItem/portal_skins/erp5_apparel/ApparelComponent_view/my_resource.xml b/bt5/erp5_apparel/SkinTemplateItem/portal_skins/erp5_apparel/ApparelComponent_view/my_product_line.xml
similarity index 63%
rename from bt5/erp5_apparel/SkinTemplateItem/portal_skins/erp5_apparel/ApparelComponent_view/my_resource.xml
rename to bt5/erp5_apparel/SkinTemplateItem/portal_skins/erp5_apparel/ApparelComponent_view/my_product_line.xml
index dc88884bc0..fbcaf9bad8 100644
--- a/bt5/erp5_apparel/SkinTemplateItem/portal_skins/erp5_apparel/ApparelComponent_view/my_resource.xml
+++ b/bt5/erp5_apparel/SkinTemplateItem/portal_skins/erp5_apparel/ApparelComponent_view/my_product_line.xml
@@ -12,15 +12,12 @@
         <item>
             <key> <string>delegated_list</string> </key>
             <value>
-              <list>
-                <string>items</string>
-                <string>title</string>
-              </list>
+              <list/>
             </value>
         </item>
         <item>
             <key> <string>id</string> </key>
-            <value> <string>my_resource</string> </value>
+            <value> <string>my_product_line</string> </value>
         </item>
         <item>
             <key> <string>message_values</string> </key>
@@ -64,20 +61,10 @@
                     <key> <string>form_id</string> </key>
                     <value> <string></string> </value>
                 </item>
-                <item>
-                    <key> <string>items</string> </key>
-                    <value>
-                      <persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
-                    </value>
-                </item>
                 <item>
                     <key> <string>target</string> </key>
                     <value> <string></string> </value>
                 </item>
-                <item>
-                    <key> <string>title</string> </key>
-                    <value> <string></string> </value>
-                </item>
               </dictionary>
             </value>
         </item>
@@ -87,46 +74,20 @@
               <dictionary>
                 <item>
                     <key> <string>field_id</string> </key>
-                    <value> <string>my_list_field</string> </value>
+                    <value> <string>my_product_line</string> </value>
                 </item>
                 <item>
                     <key> <string>form_id</string> </key>
                     <value> <string>Base_viewApparelFieldLibrary</string> </value>
                 </item>
-                <item>
-                    <key> <string>items</string> </key>
-                    <value>
-                      <list/>
-                    </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>Component Type</string> </value>
-                </item>
               </dictionary>
             </value>
         </item>
       </dictionary>
     </pickle>
   </record>
-  <record id="2" aka="AAAAAAAAAAI=">
-    <pickle>
-      <tuple>
-        <global name="TALESMethod" module="Products.Formulator.TALESField"/>
-        <tuple/>
-      </tuple>
-    </pickle>
-    <pickle>
-      <dictionary>
-        <item>
-            <key> <string>_text</string> </key>
-            <value> <string>python: getattr(here.portal_categories.resource.components, preferences.getPreference(\'preferred_category_child_item_list_method_id\', \'getCategoryChildCompactLogicalPathItemList\'))(local_sort_id=(\'int_index\', \'translated_title\'), checked_permission=\'View\')</string> </value>
-        </item>
-      </dictionary>
-    </pickle>
-  </record>
 </ZopeData>
diff --git a/bt5/erp5_apparel/SkinTemplateItem/portal_skins/erp5_apparel/ApparelFabric_view.xml b/bt5/erp5_apparel/SkinTemplateItem/portal_skins/erp5_apparel/ApparelFabric_view.xml
index 1031bfb18a..b68869230a 100644
--- a/bt5/erp5_apparel/SkinTemplateItem/portal_skins/erp5_apparel/ApparelFabric_view.xml
+++ b/bt5/erp5_apparel/SkinTemplateItem/portal_skins/erp5_apparel/ApparelFabric_view.xml
@@ -95,7 +95,7 @@
                         <string>my_title</string>
                         <string>my_reference</string>
                         <string>my_purchase_supply_line_source_reference</string>
-                        <string>my_resource</string>
+                        <string>my_product_line</string>
                         <string>my_visual_pattern</string>
                         <string>my_quantity_unit_list</string>
                         <string>my_apparel_fabric_template_title</string>
diff --git a/bt5/erp5_apparel/SkinTemplateItem/portal_skins/erp5_apparel/ApparelFabric_view/my_product_line.xml b/bt5/erp5_apparel/SkinTemplateItem/portal_skins/erp5_apparel/ApparelFabric_view/my_product_line.xml
new file mode 100644
index 0000000000..fbcaf9bad8
--- /dev/null
+++ b/bt5/erp5_apparel/SkinTemplateItem/portal_skins/erp5_apparel/ApparelFabric_view/my_product_line.xml
@@ -0,0 +1,93 @@
+<?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/>
+            </value>
+        </item>
+        <item>
+            <key> <string>id</string> </key>
+            <value> <string>my_product_line</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_product_line</string> </value>
+                </item>
+                <item>
+                    <key> <string>form_id</string> </key>
+                    <value> <string>Base_viewApparelFieldLibrary</string> </value>
+                </item>
+                <item>
+                    <key> <string>target</string> </key>
+                    <value> <string>Click to edit the target</string> </value>
+                </item>
+              </dictionary>
+            </value>
+        </item>
+      </dictionary>
+    </pickle>
+  </record>
+</ZopeData>
diff --git a/bt5/erp5_apparel/SkinTemplateItem/portal_skins/erp5_apparel/Base_viewApparelFieldLibrary.xml b/bt5/erp5_apparel/SkinTemplateItem/portal_skins/erp5_apparel/Base_viewApparelFieldLibrary.xml
index aa5fcdef29..c25e3a2760 100644
--- a/bt5/erp5_apparel/SkinTemplateItem/portal_skins/erp5_apparel/Base_viewApparelFieldLibrary.xml
+++ b/bt5/erp5_apparel/SkinTemplateItem/portal_skins/erp5_apparel/Base_viewApparelFieldLibrary.xml
@@ -134,6 +134,7 @@
                         <string>my_source_title</string>
                         <string>my_quantity_unit_list</string>
                         <string>listbox_int_index</string>
+                        <string>my_product_line</string>
                       </list>
                     </value>
                 </item>
diff --git a/bt5/erp5_apparel/SkinTemplateItem/portal_skins/erp5_apparel/ApparelFabric_view/my_resource.xml b/bt5/erp5_apparel/SkinTemplateItem/portal_skins/erp5_apparel/Base_viewApparelFieldLibrary/my_product_line.xml
similarity index 83%
rename from bt5/erp5_apparel/SkinTemplateItem/portal_skins/erp5_apparel/ApparelFabric_view/my_resource.xml
rename to bt5/erp5_apparel/SkinTemplateItem/portal_skins/erp5_apparel/Base_viewApparelFieldLibrary/my_product_line.xml
index 48e8dce5ca..ae877b4a0a 100644
--- a/bt5/erp5_apparel/SkinTemplateItem/portal_skins/erp5_apparel/ApparelFabric_view/my_resource.xml
+++ b/bt5/erp5_apparel/SkinTemplateItem/portal_skins/erp5_apparel/Base_viewApparelFieldLibrary/my_product_line.xml
@@ -13,14 +13,14 @@
             <key> <string>delegated_list</string> </key>
             <value>
               <list>
-                <string>items</string>
                 <string>title</string>
+                <string>enabled</string>
               </list>
             </value>
         </item>
         <item>
             <key> <string>id</string> </key>
-            <value> <string>my_resource</string> </value>
+            <value> <string>my_product_line</string> </value>
         </item>
         <item>
             <key> <string>message_values</string> </key>
@@ -56,6 +56,12 @@
             <key> <string>tales</string> </key>
             <value>
               <dictionary>
+                <item>
+                    <key> <string>enabled</string> </key>
+                    <value>
+                      <persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
+                    </value>
+                </item>
                 <item>
                     <key> <string>field_id</string> </key>
                     <value> <string></string> </value>
@@ -64,12 +70,6 @@
                     <key> <string>form_id</string> </key>
                     <value> <string></string> </value>
                 </item>
-                <item>
-                    <key> <string>items</string> </key>
-                    <value>
-                      <persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
-                    </value>
-                </item>
                 <item>
                     <key> <string>target</string> </key>
                     <value> <string></string> </value>
@@ -86,18 +86,16 @@
             <value>
               <dictionary>
                 <item>
-                    <key> <string>field_id</string> </key>
-                    <value> <string>my_list_field</string> </value>
+                    <key> <string>enabled</string> </key>
+                    <value> <int>1</int> </value>
                 </item>
                 <item>
-                    <key> <string>form_id</string> </key>
-                    <value> <string>Base_viewApparelFieldLibrary</string> </value>
+                    <key> <string>field_id</string> </key>
+                    <value> <string>my_category</string> </value>
                 </item>
                 <item>
-                    <key> <string>items</string> </key>
-                    <value>
-                      <list/>
-                    </value>
+                    <key> <string>form_id</string> </key>
+                    <value> <string>Base_viewFieldLibrary</string> </value>
                 </item>
                 <item>
                     <key> <string>target</string> </key>
@@ -105,7 +103,7 @@
                 </item>
                 <item>
                     <key> <string>title</string> </key>
-                    <value> <string>Fabric Type</string> </value>
+                    <value> <string>Product Line</string> </value>
                 </item>
               </dictionary>
             </value>
@@ -124,7 +122,7 @@
       <dictionary>
         <item>
             <key> <string>_text</string> </key>
-            <value> <string>python: getattr(here.portal_categories.resource.fabric, preferences.getPreference(\'preferred_category_child_item_list_method_id\', \'getCategoryChildCompactLogicalPathItemList\'))(local_sort_id=(\'int_index\', \'translated_title\'), checked_permission=\'View\')</string> </value>
+            <value> <string>python: getattr(here.portal_categories[field.getId().replace(\'my_\', \'\', 1)], \'getCategoryChildItemList\')(checked_permission=\'View\', display_none_category=0)</string> </value>
         </item>
       </dictionary>
     </pickle>
diff --git a/bt5/erp5_apparel/bt/revision b/bt5/erp5_apparel/bt/revision
index 1c5fd036ef..99bc3d5186 100644
--- a/bt5/erp5_apparel/bt/revision
+++ b/bt5/erp5_apparel/bt/revision
@@ -1 +1 @@
-252
\ No newline at end of file
+253
\ No newline at end of file
-- 
2.30.9