[Erp5-report] r9713 - in /erp5/trunk/bt5/erp5_accounting: SkinTemplateItem/portal_skins/erp...

nobody at svn.erp5.org nobody at svn.erp5.org
Wed Sep 6 17:45:13 CEST 2006


Author: jerome
Date: Wed Sep  6 17:45:07 2006
New Revision: 9713

URL: http://svn.erp5.org?rev=9713&view=rev
Log:
add a "request.other[\'is_accounting_report\'] = True" in all accounting reports, so that certain fields can be hidden in reports.


Modified:
    erp5/trunk/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/AccountModule_getAccountStatementReportSectionList.xml
    erp5/trunk/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/AccountModule_getBankAccountsReportSectionList.xml
    erp5/trunk/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/AccountModule_getGeneralLedgerReportSectionList.xml
    erp5/trunk/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/AccountModule_getOtherPartiesReportSectionList.xml
    erp5/trunk/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/AccountModule_getTrialBalanceReportSectionList.xml
    erp5/trunk/bt5/erp5_accounting/bt/revision

Modified: erp5/trunk/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/AccountModule_getAccountStatementReportSectionList.xml
URL: http://svn.erp5.org/erp5/trunk/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/AccountModule_getAccountStatementReportSectionList.xml?rev=9713&r1=9712&r2=9713&view=diff
==============================================================================
--- erp5/trunk/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/AccountModule_getAccountStatementReportSectionList.xml (original)
+++ erp5/trunk/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/AccountModule_getAccountStatementReportSectionList.xml Wed Sep  6 17:45:07 2006
@@ -68,8 +68,7 @@
         </item>
         <item>
             <key> <string>_body</string> </key>
-            <value> <string>"""\n
-Get the report sections for account statement.\n
+            <value> <string>"""Get the report sections for account statement.\n
 Account is the combination of :\n
    - node (the Account in account module)\n
    - destination_section (the Entity in organisation / person module)\n
@@ -89,6 +88,8 @@
 from_date = request.get(\'from_date\', None)\n
 omit_grouping_reference = request.get(\'omit_grouping_reference\', 0)\n
 \n
+request.other[\'is_accounting_report\'] = True\n
+\n
 params = {\n
   \'at_date\'                      : at_date,\n
   \'section_category\'             : transaction_section_category,\n
@@ -97,16 +98,6 @@
   \'accounting_transaction_line_currency\' : None,\n
   \'omit_grouping_reference\'      : omit_grouping_reference,\n
   \'from_date_summary\' : 1\n
-}\n
-\n
-preferences = {\n
-  \'preferred_accounting_transaction_at_date\'          : at_date,\n
-  \'preferred_accounting_transaction_simulation_state\' :\n
-                    transaction_simulation_state,\n
-  \'preferred_accounting_transaction_section_category\' :\n
-                    transaction_section_category,\n
-  # XXX put omit_grouping_reference in preferences ?\n
-  \'preferred_accounting_omit_grouping_reference\' : omit_grouping_reference,\n
 }\n
 \n
 if from_date:\n
@@ -121,9 +112,6 @@
 if account:\n
   params[\'node_uid\'] = context.restrictedTraverse(account).getUid()\n
 \n
-from Products.ERP5Type.Cache import clearCache\n
-clearCache() # for preferences\n
-\n
 result = []\n
 portal = context.portal_url.getPortalObject()\n
 \n
@@ -147,8 +135,8 @@
               selection_params = params,\n
               selection_columns = account_columns,\n
               listbox_display_mode = \'FlatListMode\',\n
-              selection_sort_order = [(\'delivery.stop_date\', \'ascending\')],\n
-              preferences = preferences )]\n
+              selection_sort_order = [(\'delivery.stop_date\',\n
+                                       \'ascending\')],)]\n
 # vim: syntax=python\n
 </string> </value>
         </item>
@@ -213,11 +201,10 @@
                             <string>transaction_simulation_state</string>
                             <string>from_date</string>
                             <string>omit_grouping_reference</string>
+                            <string>True</string>
+                            <string>_write_</string>
                             <string>params</string>
                             <string>preferences</string>
-                            <string>_write_</string>
-                            <string>Products.ERP5Type.Cache</string>
-                            <string>clearCache</string>
                             <string>result</string>
                             <string>portal</string>
                             <string>account_columns</string>

Modified: erp5/trunk/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/AccountModule_getBankAccountsReportSectionList.xml
URL: http://svn.erp5.org/erp5/trunk/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/AccountModule_getBankAccountsReportSectionList.xml?rev=9713&r1=9712&r2=9713&view=diff
==============================================================================
--- erp5/trunk/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/AccountModule_getBankAccountsReportSectionList.xml (original)
+++ erp5/trunk/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/AccountModule_getBankAccountsReportSectionList.xml Wed Sep  6 17:45:07 2006
@@ -132,6 +132,12 @@
             <key> <string>_code</string> </key>
             <value>
               <none/>
+            </value>
+        </item>
+        <item>
+            <key> <string>_dav_writelocks</string> </key>
+            <value>
+              <persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
             </value>
         </item>
         <item>
@@ -216,4 +222,25 @@
       </dictionary>
     </pickle>
   </record>
+  <record id="2" aka="AAAAAAAAAAI=">
+    <pickle>
+      <tuple>
+        <tuple>
+          <string>Persistence</string>
+          <string>PersistentMapping</string>
+        </tuple>
+        <none/>
+      </tuple>
+    </pickle>
+    <pickle>
+      <dictionary>
+        <item>
+            <key> <string>_container</string> </key>
+            <value>
+              <dictionary/>
+            </value>
+        </item>
+      </dictionary>
+    </pickle>
+  </record>
 </ZopeData>

Modified: erp5/trunk/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/AccountModule_getGeneralLedgerReportSectionList.xml
URL: http://svn.erp5.org/erp5/trunk/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/AccountModule_getGeneralLedgerReportSectionList.xml?rev=9713&r1=9712&r2=9713&view=diff
==============================================================================
--- erp5/trunk/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/AccountModule_getGeneralLedgerReportSectionList.xml (original)
+++ erp5/trunk/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/AccountModule_getGeneralLedgerReportSectionList.xml Wed Sep  6 17:45:07 2006
@@ -68,8 +68,7 @@
         </item>
         <item>
             <key> <string>_body</string> </key>
-            <value> <string>"""\n
-  Get the report sections for general ledger\n
+            <value> <string>"""Get the report sections for general ledger\n
 """\n
 from Products.ERP5Form.Report import ReportSection\n
 request  = context.REQUEST\n
@@ -87,13 +86,14 @@
 # TODO\n
 omit_grouping_reference = request.get(\'omit_grouping_reference\', False)\n
 \n
+request.other[\'is_accounting_report\'] = True\n
+\n
 params = { \'at_date\'                             : at_date\n
          , \'section_category\'                    : section_category\n
          , \'simulation_state\'                    : simulation_state\n
          , \'accounting_transaction_line_currency\': None\n
          , \'omit_grouping_reference\'             : omit_grouping_reference\n
          , \'from_date_summary\'                   : True\n
-         , \'is_accounting_report\'                : True\n
          }\n
 \n
 if from_date:\n
@@ -116,12 +116,13 @@
 \n
 if gap:\n
   gap_value_list = [cat_tool.gap.restrictedTraverse(gap)] + \\\n
-                    cat_tool.gap.restrictedTraverse(gap).Category_getSortedCategoryChildValueList()\n
+              cat_tool.gap.restrictedTraverse(gap).getCategoryChildValueList()\n
 else:\n
-  cat = \'gap/%s\' %  context.portal_preferences.getPreferredAccountingTransactionGap() \\\n
-                 or context.getPortalDefaultGapRoot()\n
-\n
-  gap_value_list = cat_tool.resolveCategory(cat).Category_getSortedCategoryChildValueList()\n
+  cat = \'gap/%s\' % (\n
+    context.portal_preferences.getPreferredAccountingTransactionGap()\n
+       or context.getPortalDefaultGapRoot())\n
+\n
+  gap_value_list = cat_tool.resolveCategory(cat).getCategoryChildValueList()\n
 \n
 # we don\'t want to display accounts that don\'t have any transactions associated,\n
 # so we use a cache to see if the account contains transaction or not ( regardless\n
@@ -133,13 +134,17 @@
 \n
 for c in gap_value_list:\n
   account_list = c.getGapRelatedValueList(portal_type="Account")\n
-  strict_account_list = c.getGapRelatedValueList(portal_type="Account", strict_membership=1)\n
+  strict_account_list = c.getGapRelatedValueList(portal_type="Account",\n
+                                                 strict_membership=1)\n
 \n
   skip_branch = 1\n
   for account in account_list:\n
     if account.getUid() not in account_inventory_list_cache:\n
-      account_inventory_list_cache[account.getUid()] = len(sim_tool.getInventoryList( omit_simulation = 1,\n
-          node_uid = account.getUid(), **account_inventory_list_cache_params))\n
+      account_inventory_list_cache[account.getUid()] = len(\n
+                      sim_tool.getMovementHistoryList(\n
+                          omit_simulation=1,\n
+                          node_uid=account.getUid(),\n
+                          **account_inventory_list_cache_params))\n
     if account_inventory_list_cache[account.getUid()] != 0:\n
       skip_branch = 0\n
 \n
@@ -158,8 +163,9 @@
   if len(strict_account_list):\n
     for account in strict_account_list:\n
       if account.getAccountTypeId() in (\'payable\', \'receivable\'):\n
-        for third_party_brain in context.Account_zDistinctSectionList( at_date = at_date\n
-                                                                     , simulation_state = simulation_state):\n
+        for third_party_brain in context.Account_zDistinctSectionList(\n
+                                      at_date=at_date,\n
+                                      simulation_state=simulation_state):\n
           third_party_params = params.copy()\n
           third_party_params[\'mirror_section_uid\'] = third_party_brain.uid\n
           third_party_uid = third_party_brain.uid or " = NULL"\n
@@ -167,26 +173,27 @@
                                   , account.getTitle()\n
                                   , third_party_brain.title\n
                                   )\n
-          if len(sim_tool.getInventoryList( mirror_section_uid = third_party_uid\n
-                                          , node_uid           = account.getUid()\n
-                                          , **account_inventory_list_cache_params\n
-                                          )):\n
-            result.append(ReportSection( path                 = account.getPhysicalPath()\n
-                                       , title                = title\n
-                                       , level                = 9\n
-                                       , form_id              = \'Account_viewAccountingTransactionList\'\n
-                                       , selection_name       = \'acount_preference_selection\'\n
-                                       , selection_params     = third_party_params.copy()\n
-                                       , selection_columns    = account_columns\n
-                                       , listbox_display_mode = \'FlatListMode\'\n
-                                       , selection_sort_order = [(\'delivery.stop_date\', \'ascending\')]\n
-                                       ))\n
+          if len(sim_tool.getMovementHistoryList(\n
+                        mirror_section_uid=third_party_uid,\n
+                        node_uid=account.getUid(),\n
+                        **account_inventory_list_cache_params)):\n
+            result.append(ReportSection(\n
+                      path=account.getPhysicalPath(),\n
+                      title=title,\n
+                      level=9,\n
+                      form_id=\'Account_viewAccountingTransactionList\',\n
+                      selection_name=\'acount_preference_selection\',\n
+                      selection_params=third_party_params.copy(),\n
+                      selection_columns=account_columns,\n
+                      listbox_display_mode=\'FlatListMode\',\n
+                      selection_sort_order=[(\'delivery.stop_date\',\n
+                                             \'ascending\')]))\n
 \n
       elif account.isMemberOf(\'account_type/asset/cash/bank\'):\n
         # Bank Account\n
-        for bank_account_brain in account.Account_zGetDistinctPaymentList( at_date = at_date\n
-                                                                         , simulation_state = simulation_state\n
-                                                                         ):\n
+        for bank_account_brain in account.Account_zGetDistinctPaymentList(\n
+                                      at_date=at_date,\n
+                                      simulation_state=simulation_state):\n
           bank_params = params.copy()\n
           if bank_account_brain.path is not None:\n
             bank_params[\'payment_uid\'] = bank_account_brain.uid\n
@@ -198,34 +205,35 @@
           else :\n
             bank_params[\'no_payment_uid\'] = 1\n
             title = "%s: %s" % ( c.getId(), account.getTitle())\n
-          if len(sim_tool.getInventoryList( payment_uid = bank_account_uid\n
-                                          , node_uid = account.getUid()\n
-                                          , **account_inventory_list_cache_params\n
-                                          )):\n
-            result.append(ReportSection( path                 = account.getPhysicalPath()\n
-                                       , title                = title\n
-                                       , level                = 9\n
-                                       , form_id              = \'Account_viewAccountingTransactionList\'\n
-                                       , selection_name       = \'acount_preference_selection\'\n
-                                       , selection_params     = bank_params.copy()\n
-                                       , selection_columns    = account_columns\n
-                                       , listbox_display_mode = \'FlatListMode\'\n
-                                       , selection_sort_order = [(\'delivery.stop_date\', \'ascending\')]\n
-                                       ))\n
-      else:\n
-        if len(sim_tool.getInventoryList( node_uid = account.getUid()\n
-                                        , **account_inventory_list_cache_params\n
-                                        )):\n
-          result.append(ReportSection( path                 = account.getPhysicalPath()\n
-                                     , title                = "%s: %s" % (c.getId(), account.getTitle())\n
-                                     , level                = 9\n
-                                     , form_id              = \'Account_viewAccountingTransactionList\'\n
-                                     , selection_name       = \'acount_preference_selection\'\n
-                                     , selection_params     = params\n
-                                     , selection_columns    = account_columns\n
-                                     , listbox_display_mode = \'FlatListMode\'\n
-                                     , selection_sort_order = [(\'delivery.stop_date\', \'ascending\')]\n
-                                     ))\n
+          if len(sim_tool.getMovementHistoryList(\n
+                          payment_uid=bank_account_uid,\n
+                          node_uid=account.getUid(),\n
+                          **account_inventory_list_cache_params)):\n
+            result.append(ReportSection(\n
+                      path=account.getPhysicalPath(),\n
+                      title=title,\n
+                      level=9,\n
+                      form_id=\'Account_viewAccountingTransactionList\',\n
+                      selection_name=\'accounting_report_selection\',\n
+                      selection_params=bank_params.copy(),\n
+                      selection_columns=account_columns,\n
+                      listbox_display_mode=\'FlatListMode\',\n
+                      selection_sort_order=[(\'delivery.stop_date\',\n
+                                             \'ascending\')]))\n
+      elif len(sim_tool.getMovementHistoryList(\n
+                                node_uid=account.getUid(),\n
+                                **account_inventory_list_cache_params)):\n
+          result.append(ReportSection(\n
+                        path=account.getPhysicalPath(),\n
+                        title="%s: %s" % (c.getId(), account.getTitle()),\n
+                        level=9,\n
+                        form_id=\'Account_viewAccountingTransactionList\',\n
+                        selection_name=\'accounting_report_selection\',\n
+                        selection_params=params,\n
+                        selection_columns=account_columns,\n
+                        listbox_display_mode=\'FlatListMode\',\n
+                        selection_sort_order=[(\'delivery.stop_date\',\n
+                                               \'ascending\')]))\n
 \n
 return result\n
 </string> </value>
@@ -296,8 +304,8 @@
                             <string>False</string>
                             <string>display_categories</string>
                             <string>omit_grouping_reference</string>
+                            <string>_write_</string>
                             <string>params</string>
-                            <string>_write_</string>
                             <string>result</string>
                             <string>account_columns</string>
                             <string>gap_value_list</string>

Modified: erp5/trunk/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/AccountModule_getOtherPartiesReportSectionList.xml
URL: http://svn.erp5.org/erp5/trunk/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/AccountModule_getOtherPartiesReportSectionList.xml?rev=9713&r1=9712&r2=9713&view=diff
==============================================================================
--- erp5/trunk/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/AccountModule_getOtherPartiesReportSectionList.xml (original)
+++ erp5/trunk/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/AccountModule_getOtherPartiesReportSectionList.xml Wed Sep  6 17:45:07 2006
@@ -70,8 +70,7 @@
             <key> <string>_body</string> </key>
             <value> <string encoding="cdata"><![CDATA[
 
-"""\n
-  Client & vendors accounts.\n
+"""Client & vendors accounts.\n
 """\n
 \n
 from Products.ERP5Form.Report import ReportSection\n
@@ -83,6 +82,8 @@
 role_filter_list = request.get(\'entity_role\', None)\n
 omit_balanced_accounts = request[\'omit_balanced_accounts\']\n
 from_date = request.get(\'from_date\', None)\n
+\n
+request.other[\'is_accounting_report\'] = True\n
 \n
 # role_filter_list == None means no filter on the role\n
 if role_filter_list == [\'\'] :\n
@@ -126,11 +127,17 @@
 # will tell wether this third party account is balanced or not.\n
 valid_node_uids = []\n
 if omit_balanced_accounts :\n
-  for account in portal.portal_categories.resolveCategory(\'account_type/asset/receivable\'\n
-                ).getAccountTypeRelatedValueList(strict_membership = 1, portal_type = "Account") :\n
+  for account in portal.portal_categories.resolveCategory(\n
+                    \'account_type/asset/receivable\'\n
+                ).getAccountTypeRelatedValueList(\n
+                    strict_membership=1,\n
+                    portal_type=\'Account\'):\n
     valid_node_uids.append(account.getUid())\n
-  for account in portal.portal_categories.resolveCategory(\'account_type/liability/payable\'\n
-                ).getAccountTypeRelatedValueList(strict_membership = 1, portal_type = "Account") :\n
+  for account in portal.portal_categories.resolveCategory(\n
+                    \'account_type/liability/payable\'\n
+                ).getAccountTypeRelatedValueList(\n
+                    strict_membership=1,\n
+                    portal_type=\'Account\'):\n
     valid_node_uids.append(account.getUid())\n
 \n
 if not params[\'hide_grouping\']  :\n
@@ -142,12 +149,15 @@
   if role_filter_list and o.getProperty(\'role\', []) not in role_filter_list:\n
     continue\n
 \n
-  if o.getPortalType() == \'Person\' or not o.isMemberOf(transaction_section_category):\n
+  if o.getPortalType() == \'Person\' or\\\n
+      not o.isMemberOf(transaction_section_category):\n
         # don\'t show entities belonging to the group we are reporting\n
-    if omit_balanced_accounts and (simulation_tool.getInventoryAssetPrice(\n
-                    mirror_section_uid=o.uid, node_uid = valid_node_uids, **params) == 0) :\n
+    if omit_balanced_accounts and (\n
+            simulation_tool.getInventoryAssetPrice(\n
+                    mirror_section_uid=o.uid,\n
+                    node_uid=valid_node_uids, **params) == 0):\n
       pass\n
-    else :\n
+    else:\n
       title = o.getTitle()\n
       if o.getProperty(\'role\', None):\n
         title += \' (%s)\' % o.getRoleTitle()\n
@@ -234,9 +244,10 @@
                             <string>role_filter_list</string>
                             <string>omit_balanced_accounts</string>
                             <string>from_date</string>
+                            <string>True</string>
+                            <string>_write_</string>
                             <string>result</string>
                             <string>params</string>
-                            <string>_write_</string>
                             <string>portal</string>
                             <string>simulation_tool</string>
                             <string>entity_columns</string>

Modified: erp5/trunk/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/AccountModule_getTrialBalanceReportSectionList.xml
URL: http://svn.erp5.org/erp5/trunk/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/AccountModule_getTrialBalanceReportSectionList.xml?rev=9713&r1=9712&r2=9713&view=diff
==============================================================================
--- erp5/trunk/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/AccountModule_getTrialBalanceReportSectionList.xml (original)
+++ erp5/trunk/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/AccountModule_getTrialBalanceReportSectionList.xml Wed Sep  6 17:45:07 2006
@@ -68,8 +68,7 @@
         </item>
         <item>
             <key> <string>_body</string> </key>
-            <value> <string>"""\n
-  Trial balance.\n
+            <value> <string>""" Trial balance.\n
 """\n
 from Products.ERP5Form.Report import ReportSection\n
 \n
@@ -84,6 +83,8 @@
 from_date            = request.get(\'from_date\'           , None)\n
 expand_accounts      = request.get(\'expand_accounts\'     , False)\n
 show_parent_accounts = request.get(\'show_parent_accounts\', False)\n
+\n
+request.other[\'is_accounting_report\'] = True\n
 \n
 # flat_mode is a boolean that indicate wether we should use a report tree\n
 #   or a flat list of all accounts.\n
@@ -209,8 +210,9 @@
                             <string>False</string>
                             <string>expand_accounts</string>
                             <string>show_parent_accounts</string>
+                            <string>True</string>
+                            <string>_write_</string>
                             <string>result</string>
-                            <string>True</string>
                             <string>params</string>
                             <string>balance_columns</string>
                           </tuple>

Modified: erp5/trunk/bt5/erp5_accounting/bt/revision
URL: http://svn.erp5.org/erp5/trunk/bt5/erp5_accounting/bt/revision?rev=9713&r1=9712&r2=9713&view=diff
==============================================================================
--- erp5/trunk/bt5/erp5_accounting/bt/revision (original)
+++ erp5/trunk/bt5/erp5_accounting/bt/revision Wed Sep  6 17:45:07 2006
@@ -1,1 +1,1 @@
-22
+23




More information about the Erp5-report mailing list