From 570d0a7cf52d70e3c10e080229d47f0189947692 Mon Sep 17 00:00:00 2001
From: Nicolas Delaby <nicolas@nexedi.com>
Date: Mon, 29 Nov 2010 09:55:48 +0000
Subject: [PATCH] Deprecate usage of Delivery_getSourceSectionItemList, use
 instead new generic script Base_getPreferredSectionItemList

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@40846 20353a03-c40f-0410-a6d1-a30d3c3de9de
---
 .../my_view_mode_source_section.xml            | 18 ++++++++++++++++--
 .../Delivery_getSourceSectionItemList.xml      |  7 ++++++-
 bt5/erp5_trade/bt/revision                     |  2 +-
 3 files changed, 23 insertions(+), 4 deletions(-)

diff --git a/bt5/erp5_trade/SkinTemplateItem/portal_skins/erp5_trade/Base_viewTradeFieldLibrary/my_view_mode_source_section.xml b/bt5/erp5_trade/SkinTemplateItem/portal_skins/erp5_trade/Base_viewTradeFieldLibrary/my_view_mode_source_section.xml
index c89e97ae15..f235596dfa 100644
--- a/bt5/erp5_trade/SkinTemplateItem/portal_skins/erp5_trade/Base_viewTradeFieldLibrary/my_view_mode_source_section.xml
+++ b/bt5/erp5_trade/SkinTemplateItem/portal_skins/erp5_trade/Base_viewTradeFieldLibrary/my_view_mode_source_section.xml
@@ -11,8 +11,8 @@
             <value>
               <list>
                 <string>description</string>
-                <string>title</string>
                 <string>items</string>
+                <string>title</string>
               </list>
             </value>
         </item>
@@ -54,6 +54,10 @@
             <key> <string>tales</string> </key>
             <value>
               <dictionary>
+                <item>
+                    <key> <string>description</string> </key>
+                    <value> <string></string> </value>
+                </item>
                 <item>
                     <key> <string>field_id</string> </key>
                     <value> <string></string> </value>
@@ -72,6 +76,10 @@
                     <key> <string>target</string> </key>
                     <value> <string></string> </value>
                 </item>
+                <item>
+                    <key> <string>title</string> </key>
+                    <value> <string></string> </value>
+                </item>
               </dictionary>
             </value>
         </item>
@@ -91,6 +99,12 @@
                     <key> <string>form_id</string> </key>
                     <value> <string>Base_viewFieldLibrary</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>
@@ -113,7 +127,7 @@
       <dictionary>
         <item>
             <key> <string>_text</string> </key>
-            <value> <string>here/Delivery_getSourceSectionItemList</string> </value>
+            <value> <string>python:here.Base_getPreferredSectionItemList(portal_type=\'Organisation\', validation_state=\'validated\', base_category=\'source_section\')</string> </value>
         </item>
       </dictionary>
     </pickle>
diff --git a/bt5/erp5_trade/SkinTemplateItem/portal_skins/erp5_trade/Delivery_getSourceSectionItemList.xml b/bt5/erp5_trade/SkinTemplateItem/portal_skins/erp5_trade/Delivery_getSourceSectionItemList.xml
index c953a1c859..b58b666f92 100644
--- a/bt5/erp5_trade/SkinTemplateItem/portal_skins/erp5_trade/Delivery_getSourceSectionItemList.xml
+++ b/bt5/erp5_trade/SkinTemplateItem/portal_skins/erp5_trade/Delivery_getSourceSectionItemList.xml
@@ -50,7 +50,10 @@
         </item>
         <item>
             <key> <string>_body</string> </key>
-            <value> <string>section_cat = context.portal_preferences.getPreferredSectionCategory()\n
+            <value> <string>from Products.ERP5Type.Log import log\n
+log(\'Deprecated: use Base_getPreferredSectionItemList instead.\')\n
+\n
+section_cat = context.portal_preferences.getPreferredSectionCategory()\n
 if section_cat in (None, \'\') : \n
   section_cat = context.getPortalDefaultSectionCategory()\n
 \n
@@ -109,6 +112,8 @@ return [(\'\', \'\')] + [(i.getTitle(), i.getRelativeUrl()) for i in result]\n
                         <key> <string>co_varnames</string> </key>
                         <value>
                           <tuple>
+                            <string>Products.ERP5Type.Log</string>
+                            <string>log</string>
                             <string>_getattr_</string>
                             <string>context</string>
                             <string>section_cat</string>
diff --git a/bt5/erp5_trade/bt/revision b/bt5/erp5_trade/bt/revision
index 4242f7fac9..318d1517d8 100644
--- a/bt5/erp5_trade/bt/revision
+++ b/bt5/erp5_trade/bt/revision
@@ -1 +1 @@
-1053
\ No newline at end of file
+1055
\ No newline at end of file
-- 
2.30.9