[Erp5-report] r14720 - in /erp5/trunk/bt5/erp5_banking_core: SkinTemplateItem/portal_skins/...

nobody at svn.erp5.org nobody at svn.erp5.org
Wed Jun 6 17:40:53 CEST 2007


Author: seb
Date: Wed Jun  6 17:40:53 2007
New Revision: 14720

URL: http://svn.erp5.org?rev=14720&view=rev
Log:
- add more cache in CashDelivery_generateCashDetailInputDialog
- add more vault checks in Baobab_checkStockBeforeClosingDate
- add more research in CheckbookModule

Added:
    erp5/trunk/bt5/erp5_banking_core/SkinTemplateItem/portal_skins/erp5_banking_core/CheckbookModule_viewCheckbookList/listbox_destination_payment_internal_bank_account_number.xml
    erp5/trunk/bt5/erp5_banking_core/SkinTemplateItem/portal_skins/erp5_banking_core/ListBox_initializeFastInput.xml
Modified:
    erp5/trunk/bt5/erp5_banking_core/SkinTemplateItem/portal_skins/erp5_banking_core/Baobab_checkStockBeforeClosingDate.xml
    erp5/trunk/bt5/erp5_banking_core/SkinTemplateItem/portal_skins/erp5_banking_core/Base_sortCurrencyCashList.xml
    erp5/trunk/bt5/erp5_banking_core/SkinTemplateItem/portal_skins/erp5_banking_core/CashDelivery_generateCashDetailInputDialog.xml
    erp5/trunk/bt5/erp5_banking_core/SkinTemplateItem/portal_skins/erp5_banking_core/CheckbookModule_viewCheckbookList.xml
    erp5/trunk/bt5/erp5_banking_core/SkinTemplateItem/portal_skins/erp5_banking_core/CheckbookModule_viewCheckbookList/listbox.xml
    erp5/trunk/bt5/erp5_banking_core/SkinTemplateItem/portal_skins/erp5_banking_core/CounterModule_getVaultTransactionList.xml
    erp5/trunk/bt5/erp5_banking_core/SkinTemplateItem/portal_skins/erp5_banking_core/Delivery_getVaultItemList.xml
    erp5/trunk/bt5/erp5_banking_core/bt/revision

Modified: erp5/trunk/bt5/erp5_banking_core/SkinTemplateItem/portal_skins/erp5_banking_core/Baobab_checkStockBeforeClosingDate.xml
URL: http://svn.erp5.org/erp5/trunk/bt5/erp5_banking_core/SkinTemplateItem/portal_skins/erp5_banking_core/Baobab_checkStockBeforeClosingDate.xml?rev=14720&r1=14719&r2=14720&view=diff
==============================================================================
--- erp5/trunk/bt5/erp5_banking_core/SkinTemplateItem/portal_skins/erp5_banking_core/Baobab_checkStockBeforeClosingDate.xml (original)
+++ erp5/trunk/bt5/erp5_banking_core/SkinTemplateItem/portal_skins/erp5_banking_core/Baobab_checkStockBeforeClosingDate.xml Wed Jun  6 17:40:53 2007
@@ -85,7 +85,8 @@
     user_site=0,base_site=site.getRelativeUrl(),all=1,\n
     vault_type=(\'site/surface/banque_interne\',\'site/surface/gros_paiement\',\n
                \'site/surface/gros_versement\',\'site/surface/operations_diverses\',\n
-               \'site/surface/salle_tri\'))\n
+               \'site/surface/salle_tri\',\n
+               \'site/surface/caisse_courante/encaisse_des_devises\'))\n
 for counter_vault in counter_vault_list:\n
   counter_vault_url = counter_vault[1]\n
   if counter_vault_url==\'\':\n

Modified: erp5/trunk/bt5/erp5_banking_core/SkinTemplateItem/portal_skins/erp5_banking_core/Base_sortCurrencyCashList.xml
URL: http://svn.erp5.org/erp5/trunk/bt5/erp5_banking_core/SkinTemplateItem/portal_skins/erp5_banking_core/Base_sortCurrencyCashList.xml?rev=14720&r1=14719&r2=14720&view=diff
==============================================================================
--- erp5/trunk/bt5/erp5_banking_core/SkinTemplateItem/portal_skins/erp5_banking_core/Base_sortCurrencyCashList.xml (original)
+++ erp5/trunk/bt5/erp5_banking_core/SkinTemplateItem/portal_skins/erp5_banking_core/Base_sortCurrencyCashList.xml Wed Jun  6 17:40:53 2007
@@ -79,13 +79,13 @@
       a = a_source.getResourceValue()\n
       b = b_source.getResourceValue()\n
 \n
-    # First, compare the base prices (such as 1000 and 2000 Francs CFA).\n
-    result = - cmp(a.getBasePrice(), b.getBasePrice())\n
+    # Second, compare the portal types.\n
+    result = cmp(a.getPortalType(), b.getPortalType())\n
     if result != 0:\n
       return result\n
 \n
-    # Second, compare the portal types.\n
-    result = cmp(a.getPortalType(), b.getPortalType())\n
+    # First, compare the base prices (such as 1000 and 2000 Francs CFA).\n
+    result = - cmp(a.getBasePrice(), b.getBasePrice())\n
     if result != 0:\n
       return result\n
 \n

Modified: erp5/trunk/bt5/erp5_banking_core/SkinTemplateItem/portal_skins/erp5_banking_core/CashDelivery_generateCashDetailInputDialog.xml
URL: http://svn.erp5.org/erp5/trunk/bt5/erp5_banking_core/SkinTemplateItem/portal_skins/erp5_banking_core/CashDelivery_generateCashDetailInputDialog.xml?rev=14720&r1=14719&r2=14720&view=diff
==============================================================================
--- erp5/trunk/bt5/erp5_banking_core/SkinTemplateItem/portal_skins/erp5_banking_core/CashDelivery_generateCashDetailInputDialog.xml (original)
+++ erp5/trunk/bt5/erp5_banking_core/SkinTemplateItem/portal_skins/erp5_banking_core/CashDelivery_generateCashDetailInputDialog.xml Wed Jun  6 17:40:53 2007
@@ -71,6 +71,9 @@
 # when the user clicks on the Update button, listbox is passed, and\n
 # the contents must be preserved in the form.\n
 \n
+from Products.ERP5Type.Cache import CachingMethod\n
+portal = context.getPortalObject()\n
+\n
 if listbox is None:\n
   # This is the first time.\n
   cash_status_list          = cash_detail_dict[\'cash_status_list\']\n
@@ -140,9 +143,27 @@
 \n
   # Get the currency cash objects for a given currency.\n
   currency = \'currency_module/%s\' % operation_currency\n
-  result = context.portal_catalog(portal_type = currency_cash_portal_type)\n
-  currency_cash_list = [x.getObject() for x in result if x.getObject().getPriceCurrency() == currency and len(x.getObject().getVariationList())>0]\n
-  #context.log(\'CashDelivery_generateCashDetailInputDialog\', \'currency_list = %r, operation_cur = %s\' % (currency_cash_list, operation_currency))\n
+  # This is very bad to call catalog each time, it is the bottleneck,\n
+  # So we will add a caching method here\n
+  def getCurrencyCashRelativeUrlList(currency=None, currency_cash_portal_type=None):\n
+    result = context.portal_catalog(portal_type = currency_cash_portal_type)\n
+    currency_cash_list = [x.getObject() for x in result \n
+                          if x.getObject().getPriceCurrency() == currency \n
+                          and len(x.getObject().getVariationList())>0]\n
+    return [x.getRelativeUrl() for x in currency_cash_list]\n
+  getCurrencyCashRelativeUrlList = CachingMethod(getCurrencyCashRelativeUrlList, \n
+                               id=(\'CashDelivery_generateCashDetailInputDialog\', \n
+                                              \'getCurrencyCashRelativeUrlList\'), \n
+                               cache_factory=\'erp5_ui_long\')\n
+  currency_cash_url_list = getCurrencyCashRelativeUrlList(currency=currency,\n
+                              currency_cash_portal_type=currency_cash_portal_type)\n
+  currency_cash_list = [portal.restrictedTraverse(x) for x in currency_cash_url_list]\n
+\n
+  # This is the same thing, but by using catalog, so this is not nice at all\n
+  #result = context.portal_catalog(portal_type = currency_cash_portal_type)\n
+  #currency_cash_list = [x.getObject() for x in result if x.getObject().getPriceCurrency() == currency and len(x.getObject().getVariationList())>0]\n
+\n
+  context.log(\'CashDelivery_generateCashDetailInputDialog\', \'currency_list = %r, operation_cur = %s\' % ([x.getTitle() for x in currency_cash_list], operation_currency))\n
 \n
   # If only one variation is specified, we want to display a part of cash currencies which\n
   # exists in this variation (creation year, such as 2003).\n
@@ -155,6 +176,7 @@
     currency_cash_list = new_currency_cash_list\n
 \n
   currency_cash_list = context.Base_sortCurrencyCashList(currency_cash_list)\n
+  context.log(\'CashDelivery_generateCashDetailInputDialog after sort\', \'currency_list = %r, operation_cur = %s\' % ([x.getTitle() for x in currency_cash_list], operation_currency))\n
 \n
   # Get the axis information based on the specified column base category.\n
   # axis_list_dict contains the lists of objects, while axis_dict contains\n
@@ -290,6 +312,7 @@
         currency_dict[\'column%d\' % (counter + 1)] = 0\n
       listbox.append(currency_dict)\n
       \n
+  context.log(\'generateFastInput, listbox\',listbox)\n
   other_parameter_list = (operation_currency, line_portal_type, read_only, column_base_category, use_inventory)\n
   context.Base_updateDialogForm(listbox=listbox\n
                                 , calculated_price=total_price\n
@@ -355,9 +378,13 @@
   for line in listbox:\n
     # must get the resource\n
     resource_id = line[\'resource_id\']\n
-    resource_list = context.portal_catalog(portal_type = (\'Banknote\',\'Coin\') ,id = resource_id)\n
-    resource_price = resource_list[0].getObject().getBasePrice()\n
-    line[\'resource_translated_title\'] = resource_list[0].getObject().getTranslatedTitle()\n
+    # This is a huge performance problem to call many times the catalog\n
+    # for each fast input !!!!\n
+    #resource_list = context.portal_catalog(portal_type = (\'Banknote\',\'Coin\') ,id = resource_id)\n
+    #resource_price = resource_list[0].getObject().getBasePrice()\n
+    resource_value = context.currency_cash_module[resource_id]\n
+    resource_price = resource_value.getObject().getBasePrice()\n
+    line[\'resource_translated_title\'] = resource_value.getTranslatedTitle()\n
     # get the number of lines to add\n
     if line.has_key(\'number_line_to_add\'):\n
       lines_to_add = int(line[\'number_line_to_add\'])\n
@@ -452,6 +479,11 @@
                             <string>listbox</string>
                             <string>cash_detail_dict</string>
                             <string>kw</string>
+                            <string>Products.ERP5Type.Cache</string>
+                            <string>CachingMethod</string>
+                            <string>_getattr_</string>
+                            <string>context</string>
+                            <string>portal</string>
                             <string>None</string>
                             <string>_getitem_</string>
                             <string>cash_status_list</string>
@@ -465,8 +497,6 @@
                             <string>False</string>
                             <string>use_inventory</string>
                             <string>list</string>
-                            <string>_getattr_</string>
-                            <string>context</string>
                             <string>generic_prioritized_sort</string>
                             <string>prioritized_banknote_emission_letter_list</string>
                             <string>prioritized_coin_cash_status_list</string>
@@ -483,9 +513,10 @@
                             <string>banknote_emission_letter_list</string>
                             <string>coin_emission_letter_list</string>
                             <string>currency</string>
-                            <string>result</string>
+                            <string>getCurrencyCashRelativeUrlList</string>
+                            <string>currency_cash_url_list</string>
+                            <string>currency_cash_list</string>
                             <string>len</string>
-                            <string>currency_cash_list</string>
                             <string>new_currency_cash_list</string>
                             <string>variation</string>
                             <string>currency_cash</string>
@@ -527,7 +558,7 @@
                             <string>int</string>
                             <string>next_listbox_key</string>
                             <string>resource_id</string>
-                            <string>resource_list</string>
+                            <string>resource_value</string>
                             <string>lines_to_add</string>
                             <string>xrange</string>
                             <string>num</string>

Modified: erp5/trunk/bt5/erp5_banking_core/SkinTemplateItem/portal_skins/erp5_banking_core/CheckbookModule_viewCheckbookList.xml
URL: http://svn.erp5.org/erp5/trunk/bt5/erp5_banking_core/SkinTemplateItem/portal_skins/erp5_banking_core/CheckbookModule_viewCheckbookList.xml?rev=14720&r1=14719&r2=14720&view=diff
==============================================================================
--- erp5/trunk/bt5/erp5_banking_core/SkinTemplateItem/portal_skins/erp5_banking_core/CheckbookModule_viewCheckbookList.xml (original)
+++ erp5/trunk/bt5/erp5_banking_core/SkinTemplateItem/portal_skins/erp5_banking_core/CheckbookModule_viewCheckbookList.xml Wed Jun  6 17:40:53 2007
@@ -78,6 +78,7 @@
                     <value>
                       <list>
                         <string>listbox</string>
+                        <string>listbox_destination_payment_internal_bank_account_number</string>
                       </list>
                     </value>
                 </item>

Modified: erp5/trunk/bt5/erp5_banking_core/SkinTemplateItem/portal_skins/erp5_banking_core/CheckbookModule_viewCheckbookList/listbox.xml
URL: http://svn.erp5.org/erp5/trunk/bt5/erp5_banking_core/SkinTemplateItem/portal_skins/erp5_banking_core/CheckbookModule_viewCheckbookList/listbox.xml?rev=14720&r1=14719&r2=14720&view=diff
==============================================================================
--- erp5/trunk/bt5/erp5_banking_core/SkinTemplateItem/portal_skins/erp5_banking_core/CheckbookModule_viewCheckbookList/listbox.xml (original)
+++ erp5/trunk/bt5/erp5_banking_core/SkinTemplateItem/portal_skins/erp5_banking_core/CheckbookModule_viewCheckbookList/listbox.xml Wed Jun  6 17:40:53 2007
@@ -345,7 +345,7 @@
                           <string>Title</string>
                         </tuple>
                         <tuple>
-                          <string>destination_payment_reference</string>
+                          <string>destination_payment_internal_bank_account_number</string>
                           <string>Account</string>
                         </tuple>
                         <tuple>
@@ -402,7 +402,12 @@
                 <item>
                     <key> <string>editable_columns</string> </key>
                     <value>
-                      <list/>
+                      <list>
+                        <tuple>
+                          <string>destination_payment_internal_bank_account_number</string>
+                          <string>destination_payment_internal_bank_account_number</string>
+                        </tuple>
+                      </list>
                     </value>
                 </item>
                 <item>

Added: erp5/trunk/bt5/erp5_banking_core/SkinTemplateItem/portal_skins/erp5_banking_core/CheckbookModule_viewCheckbookList/listbox_destination_payment_internal_bank_account_number.xml
URL: http://svn.erp5.org/erp5/trunk/bt5/erp5_banking_core/SkinTemplateItem/portal_skins/erp5_banking_core/CheckbookModule_viewCheckbookList/listbox_destination_payment_internal_bank_account_number.xml?rev=14720&view=auto
==============================================================================
--- erp5/trunk/bt5/erp5_banking_core/SkinTemplateItem/portal_skins/erp5_banking_core/CheckbookModule_viewCheckbookList/listbox_destination_payment_internal_bank_account_number.xml (added)
+++ erp5/trunk/bt5/erp5_banking_core/SkinTemplateItem/portal_skins/erp5_banking_core/CheckbookModule_viewCheckbookList/listbox_destination_payment_internal_bank_account_number.xml Wed Jun  6 17:40:53 2007
@@ -1,0 +1,287 @@
+<?xml version="1.0"?>
+<ZopeData>
+  <record id="1" aka="AAAAAAAAAAE=">
+    <pickle>
+      <tuple>
+        <global name="StringField" module="Products.Formulator.StandardFields"/>
+        <tuple/>
+      </tuple>
+    </pickle>
+    <pickle>
+      <dictionary>
+        <item>
+            <key> <string>_owner</string> </key>
+            <value>
+              <none/>
+            </value>
+        </item>
+        <item>
+            <key> <string>id</string> </key>
+            <value> <string>listbox_destination_payment_internal_bank_account_number</string> </value>
+        </item>
+        <item>
+            <key> <string>message_values</string> </key>
+            <value>
+              <dictionary>
+                <item>
+                    <key> <string>external_validator_failed</string> </key>
+                    <value> <string>The input failed the external validator.</string> </value>
+                </item>
+                <item>
+                    <key> <string>required_not_found</string> </key>
+                    <value> <string>Input is required but no input given.</string> </value>
+                </item>
+                <item>
+                    <key> <string>too_long</string> </key>
+                    <value> <string>Too much input was given.</string> </value>
+                </item>
+              </dictionary>
+            </value>
+        </item>
+        <item>
+            <key> <string>overrides</string> </key>
+            <value>
+              <dictionary>
+                <item>
+                    <key> <string>alternate_name</string> </key>
+                    <value> <string></string> </value>
+                </item>
+                <item>
+                    <key> <string>css_class</string> </key>
+                    <value> <string></string> </value>
+                </item>
+                <item>
+                    <key> <string>default</string> </key>
+                    <value> <string></string> </value>
+                </item>
+                <item>
+                    <key> <string>description</string> </key>
+                    <value> <string></string> </value>
+                </item>
+                <item>
+                    <key> <string>display_maxwidth</string> </key>
+                    <value> <string></string> </value>
+                </item>
+                <item>
+                    <key> <string>display_width</string> </key>
+                    <value> <string></string> </value>
+                </item>
+                <item>
+                    <key> <string>editable</string> </key>
+                    <value> <string></string> </value>
+                </item>
+                <item>
+                    <key> <string>enabled</string> </key>
+                    <value> <string></string> </value>
+                </item>
+                <item>
+                    <key> <string>external_validator</string> </key>
+                    <value> <string></string> </value>
+                </item>
+                <item>
+                    <key> <string>extra</string> </key>
+                    <value> <string></string> </value>
+                </item>
+                <item>
+                    <key> <string>hidden</string> </key>
+                    <value> <string></string> </value>
+                </item>
+                <item>
+                    <key> <string>max_length</string> </key>
+                    <value> <string></string> </value>
+                </item>
+                <item>
+                    <key> <string>required</string> </key>
+                    <value> <string></string> </value>
+                </item>
+                <item>
+                    <key> <string>title</string> </key>
+                    <value> <string></string> </value>
+                </item>
+                <item>
+                    <key> <string>truncate</string> </key>
+                    <value> <string></string> </value>
+                </item>
+                <item>
+                    <key> <string>unicode</string> </key>
+                    <value> <string></string> </value>
+                </item>
+                <item>
+                    <key> <string>whitespace_preserve</string> </key>
+                    <value> <string></string> </value>
+                </item>
+              </dictionary>
+            </value>
+        </item>
+        <item>
+            <key> <string>tales</string> </key>
+            <value>
+              <dictionary>
+                <item>
+                    <key> <string>alternate_name</string> </key>
+                    <value> <string></string> </value>
+                </item>
+                <item>
+                    <key> <string>css_class</string> </key>
+                    <value> <string></string> </value>
+                </item>
+                <item>
+                    <key> <string>default</string> </key>
+                    <value>
+                      <persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
+                    </value>
+                </item>
+                <item>
+                    <key> <string>description</string> </key>
+                    <value> <string></string> </value>
+                </item>
+                <item>
+                    <key> <string>display_maxwidth</string> </key>
+                    <value> <string></string> </value>
+                </item>
+                <item>
+                    <key> <string>display_width</string> </key>
+                    <value> <string></string> </value>
+                </item>
+                <item>
+                    <key> <string>editable</string> </key>
+                    <value> <string></string> </value>
+                </item>
+                <item>
+                    <key> <string>enabled</string> </key>
+                    <value> <string></string> </value>
+                </item>
+                <item>
+                    <key> <string>external_validator</string> </key>
+                    <value> <string></string> </value>
+                </item>
+                <item>
+                    <key> <string>extra</string> </key>
+                    <value> <string></string> </value>
+                </item>
+                <item>
+                    <key> <string>hidden</string> </key>
+                    <value> <string></string> </value>
+                </item>
+                <item>
+                    <key> <string>max_length</string> </key>
+                    <value> <string></string> </value>
+                </item>
+                <item>
+                    <key> <string>required</string> </key>
+                    <value> <string></string> </value>
+                </item>
+                <item>
+                    <key> <string>title</string> </key>
+                    <value> <string></string> </value>
+                </item>
+                <item>
+                    <key> <string>truncate</string> </key>
+                    <value> <string></string> </value>
+                </item>
+                <item>
+                    <key> <string>unicode</string> </key>
+                    <value> <string></string> </value>
+                </item>
+                <item>
+                    <key> <string>whitespace_preserve</string> </key>
+                    <value> <string></string> </value>
+                </item>
+              </dictionary>
+            </value>
+        </item>
+        <item>
+            <key> <string>values</string> </key>
+            <value>
+              <dictionary>
+                <item>
+                    <key> <string>alternate_name</string> </key>
+                    <value> <string></string> </value>
+                </item>
+                <item>
+                    <key> <string>css_class</string> </key>
+                    <value> <string></string> </value>
+                </item>
+                <item>
+                    <key> <string>default</string> </key>
+                    <value> <string></string> </value>
+                </item>
+                <item>
+                    <key> <string>description</string> </key>
+                    <value> <string></string> </value>
+                </item>
+                <item>
+                    <key> <string>display_maxwidth</string> </key>
+                    <value> <string></string> </value>
+                </item>
+                <item>
+                    <key> <string>display_width</string> </key>
+                    <value> <int>12</int> </value>
+                </item>
+                <item>
+                    <key> <string>editable</string> </key>
+                    <value> <int>0</int> </value>
+                </item>
+                <item>
+                    <key> <string>enabled</string> </key>
+                    <value> <int>1</int> </value>
+                </item>
+                <item>
+                    <key> <string>external_validator</string> </key>
+                    <value> <string></string> </value>
+                </item>
+                <item>
+                    <key> <string>extra</string> </key>
+                    <value> <string></string> </value>
+                </item>
+                <item>
+                    <key> <string>hidden</string> </key>
+                    <value> <int>0</int> </value>
+                </item>
+                <item>
+                    <key> <string>max_length</string> </key>
+                    <value> <string></string> </value>
+                </item>
+                <item>
+                    <key> <string>required</string> </key>
+                    <value> <int>0</int> </value>
+                </item>
+                <item>
+                    <key> <string>title</string> </key>
+                    <value> <string>Account Number</string> </value>
+                </item>
+                <item>
+                    <key> <string>truncate</string> </key>
+                    <value> <int>0</int> </value>
+                </item>
+                <item>
+                    <key> <string>unicode</string> </key>
+                    <value> <int>0</int> </value>
+                </item>
+                <item>
+                    <key> <string>whitespace_preserve</string> </key>
+                    <value> <int>0</int> </value>
+                </item>
+              </dictionary>
+            </value>
+        </item>
+      </dictionary>
+    </pickle>
+  </record>
+  <record id="2" aka="AAAAAAAAAAI=">
+    <pickle>
+      <tuple>
+        <global name="TALESMethod" module="Products.Formulator.TALESField"/>
+        <tuple/>
+      </tuple>
+    </pickle>
+    <pickle>
+      <dictionary>
+        <item>
+            <key> <string>_text</string> </key>
+            <value> <string>python: cell.getDestinationPaymentValue().getInternalBankAccountNumber()</string> </value>
+        </item>
+      </dictionary>
+    </pickle>
+  </record>
+</ZopeData>

Modified: erp5/trunk/bt5/erp5_banking_core/SkinTemplateItem/portal_skins/erp5_banking_core/CounterModule_getVaultTransactionList.xml
URL: http://svn.erp5.org/erp5/trunk/bt5/erp5_banking_core/SkinTemplateItem/portal_skins/erp5_banking_core/CounterModule_getVaultTransactionList.xml?rev=14720&r1=14719&r2=14720&view=diff
==============================================================================
--- erp5/trunk/bt5/erp5_banking_core/SkinTemplateItem/portal_skins/erp5_banking_core/CounterModule_getVaultTransactionList.xml (original)
+++ erp5/trunk/bt5/erp5_banking_core/SkinTemplateItem/portal_skins/erp5_banking_core/CounterModule_getVaultTransactionList.xml Wed Jun  6 17:40:53 2007
@@ -72,6 +72,10 @@
 #               between two dates\n
 \n
 from Products.ERP5Type.Document import newTempBase\n
+\n
+if from_date is not None:\n
+  if from_date == at_date:\n
+    from_date=None\n
 \n
 #context.log(\'CounterModule_getVaultTransactionList vault:\',vault)\n
 def getTranslatedTitleFromCategoryUrl(category):\n
@@ -346,6 +350,7 @@
                             <string>kw</string>
                             <string>Products.ERP5Type.Document</string>
                             <string>newTempBase</string>
+                            <string>None</string>
                             <string>getTranslatedTitleFromCategoryUrl</string>
                             <string>getTitleFromCategoryUrl</string>
                             <string>getVariationTitleList</string>
@@ -362,7 +367,6 @@
                             <string>_write_</string>
                             <string>total_inventory_list</string>
                             <string>inventory_kw</string>
-                            <string>None</string>
                             <string>_getitem_</string>
                             <string>len</string>
                             <string>kw_has_cash_status</string>

Modified: erp5/trunk/bt5/erp5_banking_core/SkinTemplateItem/portal_skins/erp5_banking_core/Delivery_getVaultItemList.xml
URL: http://svn.erp5.org/erp5/trunk/bt5/erp5_banking_core/SkinTemplateItem/portal_skins/erp5_banking_core/Delivery_getVaultItemList.xml?rev=14720&r1=14719&r2=14720&view=diff
==============================================================================
--- erp5/trunk/bt5/erp5_banking_core/SkinTemplateItem/portal_skins/erp5_banking_core/Delivery_getVaultItemList.xml (original)
+++ erp5/trunk/bt5/erp5_banking_core/SkinTemplateItem/portal_skins/erp5_banking_core/Delivery_getVaultItemList.xml Wed Jun  6 17:40:53 2007
@@ -97,7 +97,7 @@
 def getVaultItemList(vault_type=None, exclude_vault_type=None,\n
     user_site=1, leaf_node=1, strict_membership=0, assignment_list=None,\n
     site_list=None, with_base=1, all=0, first_level=0,main_agency=0,\n
-    exclude_site_list=None):\n
+    exclude_site_list=None,mode_test=0):\n
 \n
   if vault_type is None:\n
     organisation_list = []\n
@@ -184,11 +184,6 @@
   vault_dict = {}\n
   # Transform each line of the vault list\n
   keep_level = []\n
-  erp5_site = context.getPortalObject()\n
-  mode_test = 0\n
-  if hasattr(erp5_site, \'functionnal_test_mode\'):\n
-    if getattr(erp5_site,  \'functionnal_test_mode\') == 1:\n
-      mode_test = 1\n
   for vault_item in vault_list:\n
     # do not include testsite if not in test mode\n
     if mode_test == 0 and \'testsite\' in vault_item[1]:\n
@@ -223,6 +218,12 @@
   assignment_list = context.Baobab_getUserAssignmentList()\n
 else:\n
   assignment_list = None\n
+\n
+erp5_site = context.getPortalObject()\n
+mode_test = 0\n
+if hasattr(erp5_site, \'functionnal_test_mode\'):\n
+  if getattr(erp5_site,  \'functionnal_test_mode\') == 1:\n
+    mode_test = 1\n
 \n
 user_site_list = []\n
 if user_site == 1 or owner_site==1:\n
@@ -260,7 +261,8 @@
 vault_list = getVaultItemList(vault_type=vault_type, exclude_vault_type=exclude_vault_type,\n
   user_site=user_site, leaf_node=leaf_node, strict_membership=strict_membership,\n
   assignment_list=assignment_list, site_list=site_list, with_base=with_base, all=all,\n
-  first_level=first_level,main_agency=main_agency,exclude_site_list=exclude_site_list)\n
+  first_level=first_level,main_agency=main_agency,exclude_site_list=exclude_site_list,\n
+  mode_test=mode_test)\n
 \n
 if user_vault == 1:\n
   if len(user_site_list)==0:\n
@@ -366,6 +368,10 @@
                             <string>_getattr_</string>
                             <string>context</string>
                             <string>assignment_list</string>
+                            <string>erp5_site</string>
+                            <string>mode_test</string>
+                            <string>hasattr</string>
+                            <string>getattr</string>
                             <string>user_site_list</string>
                             <string>_getitem_</string>
                             <string>new_site_list</string>

Added: erp5/trunk/bt5/erp5_banking_core/SkinTemplateItem/portal_skins/erp5_banking_core/ListBox_initializeFastInput.xml
URL: http://svn.erp5.org/erp5/trunk/bt5/erp5_banking_core/SkinTemplateItem/portal_skins/erp5_banking_core/ListBox_initializeFastInput.xml?rev=14720&view=auto
==============================================================================
--- erp5/trunk/bt5/erp5_banking_core/SkinTemplateItem/portal_skins/erp5_banking_core/ListBox_initializeFastInput.xml (added)
+++ erp5/trunk/bt5/erp5_banking_core/SkinTemplateItem/portal_skins/erp5_banking_core/ListBox_initializeFastInput.xml Wed Jun  6 17:40:53 2007
@@ -1,0 +1,259 @@
+<?xml version="1.0"?>
+<ZopeData>
+  <record id="1" aka="AAAAAAAAAAE=">
+    <pickle>
+      <tuple>
+        <global name="PythonScript" module="Products.PythonScripts.PythonScript"/>
+        <tuple/>
+      </tuple>
+    </pickle>
+    <pickle>
+      <dictionary>
+        <item>
+            <key> <string>Python_magic</string> </key>
+            <value>
+              <none/>
+            </value>
+        </item>
+        <item>
+            <key> <string>Script_magic</string> </key>
+            <value> <int>3</int> </value>
+        </item>
+        <item>
+            <key> <string>__ac_local_roles__</string> </key>
+            <value>
+              <none/>
+            </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 encoding="cdata"><![CDATA[
+
+from Products.ERP5Type.Document import newTempBase\n
+from string import zfill\n
+\n
+\n
+request = context.REQUEST\n
+\n
+# It must be possible to initialise the fast input, and to add empty lines after\n
+if request.has_key(\'my_empty_line_number\'):\n
+  empty_line_number = request[\'my_empty_line_number\']\n
+\n
+\n
+l = []\n
+first_empty_line_id = 1\n
+portal_object = context.getPortalObject()\n
+int_len = 3\n
+\n
+def get_fast_input_discriminant(line_id):\n
+  line = listbox.get(line_id)\n
+  if line is not None:\n
+    resource_id = line.get(\'resource_id\')\n
+    if resource_id is not None:\n
+      cash_currency = context.currency_cash_module.get(resource_id)\n
+      if cash_currency is not None and cash_currency.hasBasePrice():\n
+        return (cash_currency.getPortalType(), -cash_currency.getBasePrice(), line_id) # First sort by base price (desc), then by line id (asc)\n
+  return line_id\n
+\n
+def sort_fast_input_lines(x, y):\n
+  criterion_x = get_fast_input_discriminant(x)\n
+  criterion_y = get_fast_input_discriminant(y)\n
+  if criterion_x < criterion_y:\n
+    return -1\n
+  elif criterion_x > criterion_y:\n
+    return 1\n
+  else:\n
+    return 0\n
+\n
+if hasattr(request, \'listbox\'):\n
+  # initialize the listbox \n
+  listbox=request[\'listbox\']\n
+\n
+  keys_list = listbox.keys()\n
+\n
+  if keys_list != []:\n
+    #keys_list.sort(lambda x,y: cmp(int(x),int(y)))\n
+    keys_list.sort(sort_fast_input_lines)\n
+    first_empty_line_id = int(keys_list[-1])+1\n
+\n
+  for i in keys_list:\n
+    o = newTempBase(portal_object, i)\n
+    o.setUid(\'new_%s\' % zfill(i,int_len))\n
+\n
+    is_empty = 1\n
+\n
+    for key in listbox[i]:\n
+      value = listbox[i][key]\n
+      # 0 was added because of checkbox field in some fast input\n
+      if (value not in [\'\',None,0]) and (key != \'listbox_key\'):\n
+        is_empty = 0\n
+      if (request.has_key(\'field_errors\')):\n
+        is_empty = 0\n
+      #o.edit(key=listbox[i][key])\n
+      o.setProperty(key,listbox[i][key])\n
+\n
+    if not is_empty:\n
+      l.append(o)\n
+    \n
+# add empty lines\n
+if not(request.has_key(\'field_errors\')):\n
+  for i in range(first_empty_line_id,first_empty_line_id+empty_line_number):\n
+\n
+    o = newTempBase(portal_object, str(i))\n
+    o.setUid(\'new_%s\' % zfill(i,int_len))   \n
+    # zfill is used here to garantee sort order - XXX - cleaner approach required\n
+    l.append(o)\n
+\n
+\n
+return l\n
+
+
+]]></string> </value>
+        </item>
+        <item>
+            <key> <string>_code</string> </key>
+            <value>
+              <none/>
+            </value>
+        </item>
+        <item>
+            <key> <string>_filepath</string> </key>
+            <value>
+              <none/>
+            </value>
+        </item>
+        <item>
+            <key> <string>_owner</string> </key>
+            <value>
+              <none/>
+            </value>
+        </item>
+        <item>
+            <key> <string>_params</string> </key>
+            <value> <string>empty_line_number=0, **kw</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>1</int> </value>
+                    </item>
+                    <item>
+                        <key> <string>co_varnames</string> </key>
+                        <value>
+                          <tuple>
+                            <string>empty_line_number</string>
+                            <string>kw</string>
+                            <string>Products.ERP5Type.Document</string>
+                            <string>newTempBase</string>
+                            <string>string</string>
+                            <string>zfill</string>
+                            <string>_getattr_</string>
+                            <string>context</string>
+                            <string>request</string>
+                            <string>_getitem_</string>
+                            <string>l</string>
+                            <string>first_empty_line_id</string>
+                            <string>portal_object</string>
+                            <string>int_len</string>
+                            <string>listbox</string>
+                            <string>get_fast_input_discriminant</string>
+                            <string>sort_fast_input_lines</string>
+                            <string>hasattr</string>
+                            <string>keys_list</string>
+                            <string>int</string>
+                            <string>_getiter_</string>
+                            <string>i</string>
+                            <string>o</string>
+                            <string>is_empty</string>
+                            <string>key</string>
+                            <string>value</string>
+                            <string>None</string>
+                            <string>range</string>
+                            <string>str</string>
+                          </tuple>
+                        </value>
+                    </item>
+                  </dictionary>
+                </state>
+              </object>
+            </value>
+        </item>
+        <item>
+            <key> <string>func_defaults</string> </key>
+            <value>
+              <tuple>
+                <int>0</int>
+              </tuple>
+            </value>
+        </item>
+        <item>
+            <key> <string>id</string> </key>
+            <value> <string>ListBox_initializeFastInput</string> </value>
+        </item>
+        <item>
+            <key> <string>title</string> </key>
+            <value> <string></string> </value>
+        </item>
+        <item>
+            <key> <string>warnings</string> </key>
+            <value>
+              <tuple/>
+            </value>
+        </item>
+      </dictionary>
+    </pickle>
+  </record>
+</ZopeData>

Modified: erp5/trunk/bt5/erp5_banking_core/bt/revision
URL: http://svn.erp5.org/erp5/trunk/bt5/erp5_banking_core/bt/revision?rev=14720&r1=14719&r2=14720&view=diff
==============================================================================
--- erp5/trunk/bt5/erp5_banking_core/bt/revision (original)
+++ erp5/trunk/bt5/erp5_banking_core/bt/revision Wed Jun  6 17:40:53 2007
@@ -1,1 +1,1 @@
-259
+262




More information about the Erp5-report mailing list