From f721c0f035d3fb3fd3da91548bc5edd3143ca182 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?J=C3=A9rome=20Perrin?= <jerome@nexedi.com>
Date: Thu, 10 Jun 2010 08:23:18 +0000
Subject: [PATCH] fix some regressions in reports

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@36199 20353a03-c40f-0410-a6d1-a30d3c3de9de
---
 .../AccountModule_getGeneralLedgerReportSectionList.xml        | 1 +
 .../AccountingTransactionLine_getProjectItemList.xml           | 3 +++
 .../AccountingTransactionModule_getJournalSectionLineList.xml  | 2 ++
 bt5/erp5_accounting/bt/revision                                | 2 +-
 4 files changed, 7 insertions(+), 1 deletion(-)

diff --git a/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/AccountModule_getGeneralLedgerReportSectionList.xml b/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/AccountModule_getGeneralLedgerReportSectionList.xml
index 5af53dfb5d..2d40cbf7ec 100644
--- a/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/AccountModule_getGeneralLedgerReportSectionList.xml
+++ b/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/AccountModule_getGeneralLedgerReportSectionList.xml
@@ -194,6 +194,7 @@ account_type_to_group_by_mirror_section = [\n
 \n
 if gap_list or gap_root:\n
   params[\'node_category\'] = gap_list or gap_root\n
+  default_selection_params[\'node_category\'] = gap_list or gap_root\n
 \n
 report_section_list = []\n
 \n
diff --git a/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/AccountingTransactionLine_getProjectItemList.xml b/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/AccountingTransactionLine_getProjectItemList.xml
index 538b95ce61..3ae3401e19 100644
--- a/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/AccountingTransactionLine_getProjectItemList.xml
+++ b/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/AccountingTransactionLine_getProjectItemList.xml
@@ -56,6 +56,7 @@
             <value> <string>"""Returns the item list of possible projects to use on accounting lines.\n
 \n
 This script is indented to be used on custom listfields for accounting lines, and on reports.\n
+If this script returns an empty list, it means that reports by project are disabled.\n
 """\n
 portal = context.getPortalObject()\n
 request = portal.REQUEST\n
@@ -79,6 +80,8 @@ if context.getPortalType() == \'Accounting Transaction Module\':\n
       project = getObject(brain.project_uid)\n
       project_list.append((project.getTitle(), project.getRelativeUrl(),))\n
   project_list.sort(key=lambda x:x[0])\n
+  if not project_list:\n
+    return [] # returning an empty list, not to add project column on reports\n
   return [(\'\', \'\')] + project_list\n
   \n
 # case 2: script is used on custom listfields.\n
diff --git a/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/AccountingTransactionModule_getJournalSectionLineList.xml b/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/AccountingTransactionModule_getJournalSectionLineList.xml
index 0b1256d354..508e73df12 100644
--- a/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/AccountingTransactionModule_getJournalSectionLineList.xml
+++ b/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/AccountingTransactionModule_getJournalSectionLineList.xml
@@ -65,6 +65,7 @@ if payment:\n
 \n
 if group_by:\n
   extra_kw[\'group_by\'] = group_by\n
+  extra_kw[\'ignore_group_by\'] = True\n
 \n
 account_title_cache = dict()\n
 def getAccountId(node_relative_url):\n
@@ -230,6 +231,7 @@ return line_list\n
                             <string>dict</string>
                             <string>extra_kw</string>
                             <string>_write_</string>
+                            <string>True</string>
                             <string>account_title_cache</string>
                             <string>getAccountId</string>
                             <string>account_in_gap_root_cache</string>
diff --git a/bt5/erp5_accounting/bt/revision b/bt5/erp5_accounting/bt/revision
index 458361b90b..1080e3fef4 100644
--- a/bt5/erp5_accounting/bt/revision
+++ b/bt5/erp5_accounting/bt/revision
@@ -1 +1 @@
-1263
\ No newline at end of file
+1268
\ No newline at end of file
-- 
2.30.9