From 532750ea9d24014c5fe0c3d8a1baa5a39435d0ff Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?C=C3=A9dric=20Le=20Ninivin?= <cedric.leninivin@tiolive.com>
Date: Thu, 29 Jan 2015 15:55:24 +0000
Subject: [PATCH] accouting_reports: Add
 Base_getSectionCategoryItemListForReport for section category

---
 ...se_getSectionCategoryItemListForReport.xml | 68 +++++++++++++++++++
 .../your_section_category.xml                 |  4 +-
 2 files changed, 70 insertions(+), 2 deletions(-)
 create mode 100644 bt5/erp5_base/SkinTemplateItem/portal_skins/erp5_base/Base_getSectionCategoryItemListForReport.xml

diff --git a/bt5/erp5_base/SkinTemplateItem/portal_skins/erp5_base/Base_getSectionCategoryItemListForReport.xml b/bt5/erp5_base/SkinTemplateItem/portal_skins/erp5_base/Base_getSectionCategoryItemListForReport.xml
new file mode 100644
index 0000000000..b28dba7644
--- /dev/null
+++ b/bt5/erp5_base/SkinTemplateItem/portal_skins/erp5_base/Base_getSectionCategoryItemListForReport.xml
@@ -0,0 +1,68 @@
+<?xml version="1.0"?>
+<ZopeData>
+  <record id="1" aka="AAAAAAAAAAE=">
+    <pickle>
+      <global name="PythonScript" module="Products.PythonScripts.PythonScript"/>
+    </pickle>
+    <pickle>
+      <dictionary>
+        <item>
+            <key> <string>Script_magic</string> </key>
+            <value> <int>3</int> </value>
+        </item>
+        <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>
+                            <item>
+                                <key> <string>name_container</string> </key>
+                                <value> <string>container</string> </value>
+                            </item>
+                            <item>
+                                <key> <string>name_context</string> </key>
+                                <value> <string>context</string> </value>
+                            </item>
+                            <item>
+                                <key> <string>name_m_self</string> </key>
+                                <value> <string>script</string> </value>
+                            </item>
+                            <item>
+                                <key> <string>name_subpath</string> </key>
+                                <value> <string>traverse_subpath</string> </value>
+                            </item>
+                          </dictionary>
+                        </value>
+                    </item>
+                  </dictionary>
+                </state>
+              </object>
+            </value>
+        </item>
+        <item>
+            <key> <string>_body</string> </key>
+            <value> <string>return context.portal_categories.group.getCategoryChildTranslatedIndentedTitleItemList(\n
+                  base=True, local_sort_id=(\'int_index\', \'translated_title\'))\n
+</string> </value>
+        </item>
+        <item>
+            <key> <string>_params</string> </key>
+            <value> <string></string> </value>
+        </item>
+        <item>
+            <key> <string>id</string> </key>
+            <value> <string>Base_getSectionCategoryItemListForReport</string> </value>
+        </item>
+      </dictionary>
+    </pickle>
+  </record>
+</ZopeData>
diff --git a/bt5/erp5_core_proxy_field_legacy/SkinTemplateItem/portal_skins/erp5_core_proxy_field_legacy/Base_viewDialogFieldLibrary/your_section_category.xml b/bt5/erp5_core_proxy_field_legacy/SkinTemplateItem/portal_skins/erp5_core_proxy_field_legacy/Base_viewDialogFieldLibrary/your_section_category.xml
index cb4c19fbd7..e34f4ba95f 100644
--- a/bt5/erp5_core_proxy_field_legacy/SkinTemplateItem/portal_skins/erp5_core_proxy_field_legacy/Base_viewDialogFieldLibrary/your_section_category.xml
+++ b/bt5/erp5_core_proxy_field_legacy/SkinTemplateItem/portal_skins/erp5_core_proxy_field_legacy/Base_viewDialogFieldLibrary/your_section_category.xml
@@ -271,7 +271,7 @@
       <dictionary>
         <item>
             <key> <string>_text</string> </key>
-            <value> <string>preferences/getPreferredSectionCategory</string> </value>
+            <value> <string>python: preferences.getPreferredSectionCategory() in [x[1] for x in field.get_value(\'items\')] and preferences.getPreferredSectionCategory() or None</string> </value>
         </item>
       </dictionary>
     </pickle>
@@ -284,7 +284,7 @@
       <dictionary>
         <item>
             <key> <string>_text</string> </key>
-            <value> <string>python:here.Base_getPreferredCategoryChildItemList(here.portal_categories.group, base=True)</string> </value>
+            <value> <string>context/Base_getSectionCategoryItemListForReport</string> </value>
         </item>
       </dictionary>
     </pickle>
-- 
2.30.9