[Erp5-report] r41545 jerome - in /erp5/trunk/bt5/erp5_accounting: SkinTemplateItem/portal_s...

nobody at svn.erp5.org nobody at svn.erp5.org
Mon Dec 20 15:28:11 CET 2010


Author: jerome
Date: Mon Dec 20 15:28:11 2010
New Revision: 41545

URL: http://svn.erp5.org?rev=41545&view=rev
Log:
in dialogs, display all validated accounts and accounts that have been used in movements

Added:
    erp5/trunk/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/ERP5Site_getAccountItemList.xml
Modified:
    erp5/trunk/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/AccountModule_viewDialogFieldLibrary/your_node.xml
    erp5/trunk/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/AccountingTransactionModule_viewSearchDialog/your_node.xml
    erp5/trunk/bt5/erp5_accounting/bt/revision

Modified: erp5/trunk/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/AccountModule_viewDialogFieldLibrary/your_node.xml
URL: http://svn.erp5.org/erp5/trunk/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/AccountModule_viewDialogFieldLibrary/your_node.xml?rev=41545&r1=41544&r2=41545&view=diff
==============================================================================
--- erp5/trunk/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/AccountModule_viewDialogFieldLibrary/your_node.xml [utf8] (original)
+++ erp5/trunk/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/AccountModule_viewDialogFieldLibrary/your_node.xml [utf8] Mon Dec 20 15:28:11 2010
@@ -265,13 +265,7 @@
   </record>
   <record id="2" aka="AAAAAAAAAAI=">
     <pickle>
-      <tuple>
-        <tuple>
-          <string>Products.Formulator.TALESField</string>
-          <string>TALESMethod</string>
-        </tuple>
-        <none/>
-      </tuple>
+      <global name="TALESMethod" module="Products.Formulator.TALESField"/>
     </pickle>
     <pickle>
       <dictionary>
@@ -284,19 +278,13 @@
   </record>
   <record id="3" aka="AAAAAAAAAAM=">
     <pickle>
-      <tuple>
-        <tuple>
-          <string>Products.Formulator.TALESField</string>
-          <string>TALESMethod</string>
-        </tuple>
-        <none/>
-      </tuple>
+      <global name="TALESMethod" module="Products.Formulator.TALESField"/>
     </pickle>
     <pickle>
       <dictionary>
         <item>
             <key> <string>_text</string> </key>
-            <value> <string>python:here.AccountingTransactionLine_getNodeItemList()</string> </value>
+            <value> <string>python: context.ERP5Site_getAccountItemList(section_category=request.get(\'your_section_category\', preferences.getPreferredAccountingTransactionSectionCategory()), section_category_strict=request.get(\'your_section_category_strict\', preferences.getPreferredAccountingSectionCategoryStrict()), from_date=request.get(\'your_from_date\', preferences.getPreferredAccountingTransactionFromDate()))</string> </value>
         </item>
       </dictionary>
     </pickle>

Modified: erp5/trunk/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/AccountingTransactionModule_viewSearchDialog/your_node.xml
URL: http://svn.erp5.org/erp5/trunk/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/AccountingTransactionModule_viewSearchDialog/your_node.xml?rev=41545&r1=41544&r2=41545&view=diff
==============================================================================
--- erp5/trunk/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/AccountingTransactionModule_viewSearchDialog/your_node.xml [utf8] (original)
+++ erp5/trunk/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/AccountingTransactionModule_viewSearchDialog/your_node.xml [utf8] Mon Dec 20 15:28:11 2010
@@ -259,13 +259,7 @@
   </record>
   <record id="2" aka="AAAAAAAAAAI=">
     <pickle>
-      <tuple>
-        <tuple>
-          <string>Products.Formulator.TALESField</string>
-          <string>TALESMethod</string>
-        </tuple>
-        <none/>
-      </tuple>
+      <global name="TALESMethod" module="Products.Formulator.TALESField"/>
     </pickle>
     <pickle>
       <dictionary>
@@ -278,19 +272,13 @@
   </record>
   <record id="3" aka="AAAAAAAAAAM=">
     <pickle>
-      <tuple>
-        <tuple>
-          <string>Products.Formulator.TALESField</string>
-          <string>TALESMethod</string>
-        </tuple>
-        <none/>
-      </tuple>
+      <global name="TALESMethod" module="Products.Formulator.TALESField"/>
     </pickle>
     <pickle>
       <dictionary>
         <item>
             <key> <string>_text</string> </key>
-            <value> <string>here/AccountingTransactionLine_getNodeItemList</string> </value>
+            <value> <string>python: context.ERP5Site_getAccountItemList(section_category=request.get(\'your_section_category\', preferences.getPreferredAccountingTransactionSectionCategory()), section_category_strict=request.get(\'your_section_category_strict\', preferences.getPreferredAccountingSectionCategoryStrict()), from_date=request.get(\'your_from_date\', preferences.getPreferredAccountingTransactionFromDate()))</string> </value>
         </item>
       </dictionary>
     </pickle>

Added: erp5/trunk/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/ERP5Site_getAccountItemList.xml
URL: http://svn.erp5.org/erp5/trunk/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/ERP5Site_getAccountItemList.xml?rev=41545&view=auto
==============================================================================
--- erp5/trunk/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/ERP5Site_getAccountItemList.xml (added)
+++ erp5/trunk/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/ERP5Site_getAccountItemList.xml [utf8] Mon Dec 20 15:28:11 2010
@@ -0,0 +1,184 @@
+<?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>\'\'\'Returns all validated accounts + all accounts used by this group on existing\n
+movements.\n
+\n
+\'\'\'\n
+from Products.ERP5Type.Cache import CachingMethod\n
+\n
+portal = context.getPortalObject()\n
+\n
+def getAccountItemList(section_category,\n
+                       section_category_strict,\n
+                       from_date,\n
+                       lang):\n
+\n
+  def sorted(seq, key):\n
+    seq = seq[::]\n
+    seq.sort(key=key)\n
+    return seq\n
+\n
+  account_dict = dict()\n
+  for account in portal.account_module.searchFolder(\n
+                            portal_type=\'Account\',\n
+                            validation_state=(\'validated\',), ):\n
+    account = account.getObject()\n
+\n
+    account_dict[account.getUid()] = [\n
+        account.Account_getFormattedTitle(),\n
+        account.getRelativeUrl(), ]\n
+\n
+  search_kw = dict(\n
+      portal_type=portal.getPortalAccountingMovementTypeList(),\n
+      ignore_group_by=True,\n
+      group_by_node=True,)\n
+  if from_date:\n
+    search_kw[\'from_date\'] = from_date\n
+  if section_category_strict:\n
+    search_kw[\'section_category_strict_membership\'] = section_category\n
+  else:\n
+    search_kw[\'section_category\'] = section_category\n
+\n
+  # add to this the accounts that have been used in accounting transactions.\n
+  for brain in portal.portal_simulation.getCurrentInventoryList( **search_kw ):\n
+    if brain.node_uid and brain.node_uid not in account_dict:\n
+      account = portal.portal_catalog.getObject(brain.node_uid)\n
+      account_dict[brain.node_uid] = [\n
+        account.Account_getFormattedTitle(),\n
+        account.getRelativeUrl(), ]\n
+\n
+  return [(\'\', \'\')] + sorted(account_dict.values(),\n
+                key=lambda item: item[1])\n
+\n
+getAccountItemList = CachingMethod(getAccountItemList,\n
+                                   id=script.getId(),\n
+                                   cache_factory=\'erp5_content_long\')\n
+\n
+return getAccountItemList(section_category,\n
+                          section_category_strict,\n
+                          lang=portal.Localizer.get_selected_language(),\n
+                          from_date=from_date)\n
+</string> </value>
+        </item>
+        <item>
+            <key> <string>_code</string> </key>
+            <value>
+              <none/>
+            </value>
+        </item>
+        <item>
+            <key> <string>_params</string> </key>
+            <value> <string>section_category, section_category_strict, from_date</string> </value>
+        </item>
+        <item>
+            <key> <string>errors</string> </key>
+            <value>
+              <tuple/>
+            </value>
+        </item>
+        <item>
+            <key> <string>func_code</string> </key>
+            <value>
+              <object>
+                <klass>
+                  <global name="FuncCode" module="Shared.DC.Scripts.Signature"/>
+                </klass>
+                <tuple/>
+                <state>
+                  <dictionary>
+                    <item>
+                        <key> <string>co_argcount</string> </key>
+                        <value> <int>3</int> </value>
+                    </item>
+                    <item>
+                        <key> <string>co_varnames</string> </key>
+                        <value>
+                          <tuple>
+                            <string>section_category</string>
+                            <string>section_category_strict</string>
+                            <string>from_date</string>
+                            <string>Products.ERP5Type.Cache</string>
+                            <string>CachingMethod</string>
+                            <string>_getattr_</string>
+                            <string>context</string>
+                            <string>portal</string>
+                            <string>getAccountItemList</string>
+                            <string>script</string>
+                          </tuple>
+                        </value>
+                    </item>
+                  </dictionary>
+                </state>
+              </object>
+            </value>
+        </item>
+        <item>
+            <key> <string>func_defaults</string> </key>
+            <value>
+              <none/>
+            </value>
+        </item>
+        <item>
+            <key> <string>id</string> </key>
+            <value> <string>ERP5Site_getAccountItemList</string> </value>
+        </item>
+        <item>
+            <key> <string>warnings</string> </key>
+            <value>
+              <tuple/>
+            </value>
+        </item>
+      </dictionary>
+    </pickle>
+  </record>
+</ZopeData>

Modified: erp5/trunk/bt5/erp5_accounting/bt/revision
URL: http://svn.erp5.org/erp5/trunk/bt5/erp5_accounting/bt/revision?rev=41545&r1=41544&r2=41545&view=diff
==============================================================================
--- erp5/trunk/bt5/erp5_accounting/bt/revision [utf8] (original)
+++ erp5/trunk/bt5/erp5_accounting/bt/revision [utf8] Mon Dec 20 15:28:11 2010
@@ -1 +1 @@
-1412
\ No newline at end of file
+1413
\ No newline at end of file



More information about the Erp5-report mailing list