[Erp5-report] r13126 - in /erp5/trunk/bt5/erp5_accounting_l10n_fr_m9: SkinTemplateItem/port...

nobody at svn.erp5.org nobody at svn.erp5.org
Thu Mar 1 13:47:15 CET 2007


Author: jerome
Date: Thu Mar  1 13:46:53 2007
New Revision: 13126

URL: http://svn.erp5.org?rev=13126&view=rev
Log:
Add a Transfer_getPaymentTransactionList script to return the list of related
transaction in a stable order (sorted on source/destination_reference), and use
it on all Transfer forms.
Improve script to text to display on the transfer
(PaymentTransaction_getTransferReference)


Added:
    erp5/trunk/bt5/erp5_accounting_l10n_fr_m9/SkinTemplateItem/portal_skins/erp5_accounting_l10n_fr_m9/Transfer_getPaymentTransactionList.xml
Modified:
    erp5/trunk/bt5/erp5_accounting_l10n_fr_m9/SkinTemplateItem/portal_skins/erp5_accounting_l10n_fr_m9/PaymentTransaction_getTransferReference.xml
    erp5/trunk/bt5/erp5_accounting_l10n_fr_m9/SkinTemplateItem/portal_skins/erp5_accounting_l10n_fr_m9/Transfer_view/listbox.xml
    erp5/trunk/bt5/erp5_accounting_l10n_fr_m9/SkinTemplateItem/portal_skins/erp5_accounting_l10n_fr_m9/Transfer_view/total_amount.xml
    erp5/trunk/bt5/erp5_accounting_l10n_fr_m9/SkinTemplateItem/portal_skins/erp5_accounting_l10n_fr_m9/Transfer_viewFastInputDialog/listbox.xml
    erp5/trunk/bt5/erp5_accounting_l10n_fr_m9/SkinTemplateItem/portal_skins/erp5_accounting_l10n_fr_m9/Transfer_viewTransferReportSection/listbox.xml
    erp5/trunk/bt5/erp5_accounting_l10n_fr_m9/bt/revision

Modified: erp5/trunk/bt5/erp5_accounting_l10n_fr_m9/SkinTemplateItem/portal_skins/erp5_accounting_l10n_fr_m9/PaymentTransaction_getTransferReference.xml
URL: http://svn.erp5.org/erp5/trunk/bt5/erp5_accounting_l10n_fr_m9/SkinTemplateItem/portal_skins/erp5_accounting_l10n_fr_m9/PaymentTransaction_getTransferReference.xml?rev=13126&r1=13125&r2=13126&view=diff
==============================================================================
--- erp5/trunk/bt5/erp5_accounting_l10n_fr_m9/SkinTemplateItem/portal_skins/erp5_accounting_l10n_fr_m9/PaymentTransaction_getTransferReference.xml (original)
+++ erp5/trunk/bt5/erp5_accounting_l10n_fr_m9/SkinTemplateItem/portal_skins/erp5_accounting_l10n_fr_m9/PaymentTransaction_getTransferReference.xml Thu Mar  1 13:46:53 2007
@@ -68,15 +68,49 @@
         </item>
         <item>
             <key> <string>_body</string> </key>
-            <value> <string>transaction_portal_type = context.getPortalAccountingTransactionTypeList()\n
+            <value> <string>""" The label to display for a payment transaction\n
+"""\n
+\n
+transaction_portal_type = context.getPortalAccountingTransactionTypeList()\n
 \n
 transfer_reference = context.getShortTitle()\n
 if transfer_reference:\n
   return transfer_reference\n
+\n
+invoice = context.getDefaultCausalityValue(portal_type=transaction_portal_type)\n
+\n
+if context.getOriginId() == \'OP\':\n
+  libel = ""\n
+  if context.getDescription():\n
+    libel = context.getDescription().splitlines()[0]\n
+  elif invoice is not None and invoice.getDescription():\n
+    libel = (invoice.getDescription() or \'\').splitlines()[0]\n
+  else:\n
+    libel = context.getTitle()\n
+  return "%05d %s" % (context.getIntIndex(), libel)\n
+\n
+if invoice is not None:\n
+  libel = \'\'\n
+  # XXX an ad hoc local property can be used as int_index.\n
+  if context.getProperty(\'numdd\'):\n
+    libel = context.getProperty(\'numdd\')\n
+  else:\n
+    libel = "%05d" % invoice.getIntIndex()\n
+\n
+  if invoice.AccountingTransaction_isSourceView():\n
+    bank_account = invoice.getDestinationPaymentValue()\n
+    if bank_account.getPortalType() == \'External Payment\':\n
+      libel += \' %s\' % invoice.getDestinationSectionTitle()\n
+  else:\n
+    bank_account = invoice.getSourcePaymentValue()\n
+    if bank_account.getPortalType() == \'External Payment\':\n
+      libel += \' %s\' % invoice.getSourceSectionTitle()\n
   \n
-invoice = context.getDefaultCausalityValue(portal_type=transaction_portal_type)\n
-if invoice is not None:\n
-  return invoice.getReference()\n
+  invoice_description = invoice.getDescription() or invoice.getTitle()\n
+  \n
+  return "%s %s" % (libel, invoice_description.splitlines()[0])\n
+\n
+return \'\'\n
 </string> </value>
         </item>
         <item>
@@ -130,7 +164,11 @@
                             <string>transaction_portal_type</string>
                             <string>transfer_reference</string>
                             <string>invoice</string>
+                            <string>libel</string>
+                            <string>_getitem_</string>
                             <string>None</string>
+                            <string>bank_account</string>
+                            <string>invoice_description</string>
                           </tuple>
                         </value>
                     </item>

Added: erp5/trunk/bt5/erp5_accounting_l10n_fr_m9/SkinTemplateItem/portal_skins/erp5_accounting_l10n_fr_m9/Transfer_getPaymentTransactionList.xml
URL: http://svn.erp5.org/erp5/trunk/bt5/erp5_accounting_l10n_fr_m9/SkinTemplateItem/portal_skins/erp5_accounting_l10n_fr_m9/Transfer_getPaymentTransactionList.xml?rev=13126&view=auto
==============================================================================
--- erp5/trunk/bt5/erp5_accounting_l10n_fr_m9/SkinTemplateItem/portal_skins/erp5_accounting_l10n_fr_m9/Transfer_getPaymentTransactionList.xml (added)
+++ erp5/trunk/bt5/erp5_accounting_l10n_fr_m9/SkinTemplateItem/portal_skins/erp5_accounting_l10n_fr_m9/Transfer_getPaymentTransactionList.xml Thu Mar  1 13:46:53 2007
@@ -1,0 +1,188 @@
+<?xml version="1.0"?>
+<ZopeData>
+  <record id="1" aka="AAAAAAAAAAE=">
+    <pickle>
+      <tuple>
+        <tuple>
+          <string>Products.PythonScripts.PythonScript</string>
+          <string>PythonScript</string>
+        </tuple>
+        <none/>
+      </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>numordre_cache = dict()\n
+def getNumordre(tr):\n
+  \'\'\'calculate numordre and cache it.\n
+  \'\'\'\n
+  try:\n
+    return numordre_cache[tr]\n
+  except KeyError:\n
+    return numordre_cache.setdefault(tr, tr.getProperty(\'noordre\',\n
+                                            tr.getSourceReference()))\n
+\n
+def transfer_comparator(a, b):\n
+  \'\'\'Compare 2 accounting transactions.\n
+  \'\'\'\n
+  return cmp(getNumordre(a), getNumordre(b))\n
+\n
+\n
+def getPaymentTransactionList():\n
+  transaction_list = context.getAggregateRelatedValueList(\n
+                               portal_type=\'Payment Transaction\')\n
+  transaction_list.sort(transfer_comparator)\n
+  return transaction_list\n
+\n
+from Products.ERP5Type.Cache import CachingMethod\n
+no_getPaymentTransactionList = CachingMethod(\n
+                               getPaymentTransactionList,\n
+                               id=\'%s%s\' % (script.getId(),\n
+                                            context.getId()))\n
+\n
+\n
+return getPaymentTransactionList()\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>**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>0</int> </value>
+                    </item>
+                    <item>
+                        <key> <string>co_varnames</string> </key>
+                        <value>
+                          <tuple>
+                            <string>kw</string>
+                            <string>dict</string>
+                            <string>numordre_cache</string>
+                            <string>getNumordre</string>
+                            <string>transfer_comparator</string>
+                            <string>getPaymentTransactionList</string>
+                            <string>Products.ERP5Type.Cache</string>
+                            <string>CachingMethod</string>
+                            <string>_getattr_</string>
+                            <string>script</string>
+                            <string>context</string>
+                            <string>no_getPaymentTransactionList</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>Transfer_getPaymentTransactionList</string> </value>
+        </item>
+        <item>
+            <key> <string>warnings</string> </key>
+            <value>
+              <tuple/>
+            </value>
+        </item>
+      </dictionary>
+    </pickle>
+  </record>
+</ZopeData>

Modified: erp5/trunk/bt5/erp5_accounting_l10n_fr_m9/SkinTemplateItem/portal_skins/erp5_accounting_l10n_fr_m9/Transfer_view/listbox.xml
URL: http://svn.erp5.org/erp5/trunk/bt5/erp5_accounting_l10n_fr_m9/SkinTemplateItem/portal_skins/erp5_accounting_l10n_fr_m9/Transfer_view/listbox.xml?rev=13126&r1=13125&r2=13126&view=diff
==============================================================================
--- erp5/trunk/bt5/erp5_accounting_l10n_fr_m9/SkinTemplateItem/portal_skins/erp5_accounting_l10n_fr_m9/Transfer_view/listbox.xml (original)
+++ erp5/trunk/bt5/erp5_accounting_l10n_fr_m9/SkinTemplateItem/portal_skins/erp5_accounting_l10n_fr_m9/Transfer_view/listbox.xml Thu Mar  1 13:46:53 2007
@@ -585,7 +585,7 @@
       <dictionary>
         <item>
             <key> <string>method_name</string> </key>
-            <value> <string>getAggregateRelatedValueList</string> </value>
+            <value> <string>Transfer_getPaymentTransactionList</string> </value>
         </item>
       </dictionary>
     </pickle>

Modified: erp5/trunk/bt5/erp5_accounting_l10n_fr_m9/SkinTemplateItem/portal_skins/erp5_accounting_l10n_fr_m9/Transfer_view/total_amount.xml
URL: http://svn.erp5.org/erp5/trunk/bt5/erp5_accounting_l10n_fr_m9/SkinTemplateItem/portal_skins/erp5_accounting_l10n_fr_m9/Transfer_view/total_amount.xml?rev=13126&r1=13125&r2=13126&view=diff
==============================================================================
--- erp5/trunk/bt5/erp5_accounting_l10n_fr_m9/SkinTemplateItem/portal_skins/erp5_accounting_l10n_fr_m9/Transfer_view/total_amount.xml (original)
+++ erp5/trunk/bt5/erp5_accounting_l10n_fr_m9/SkinTemplateItem/portal_skins/erp5_accounting_l10n_fr_m9/Transfer_view/total_amount.xml Thu Mar  1 13:46:53 2007
@@ -189,11 +189,11 @@
                 </item>
                 <item>
                     <key> <string>css_class</string> </key>
-                    <value> <string></string> </value>
+                    <value> <string>figure</string> </value>
                 </item>
                 <item>
                     <key> <string>default</string> </key>
-                    <value> <string>figure</string> </value>
+                    <value> <string></string> </value>
                 </item>
                 <item>
                     <key> <string>description</string> </key>

Modified: erp5/trunk/bt5/erp5_accounting_l10n_fr_m9/SkinTemplateItem/portal_skins/erp5_accounting_l10n_fr_m9/Transfer_viewFastInputDialog/listbox.xml
URL: http://svn.erp5.org/erp5/trunk/bt5/erp5_accounting_l10n_fr_m9/SkinTemplateItem/portal_skins/erp5_accounting_l10n_fr_m9/Transfer_viewFastInputDialog/listbox.xml?rev=13126&r1=13125&r2=13126&view=diff
==============================================================================
--- erp5/trunk/bt5/erp5_accounting_l10n_fr_m9/SkinTemplateItem/portal_skins/erp5_accounting_l10n_fr_m9/Transfer_viewFastInputDialog/listbox.xml (original)
+++ erp5/trunk/bt5/erp5_accounting_l10n_fr_m9/SkinTemplateItem/portal_skins/erp5_accounting_l10n_fr_m9/Transfer_viewFastInputDialog/listbox.xml Thu Mar  1 13:46:53 2007
@@ -563,7 +563,7 @@
       <dictionary>
         <item>
             <key> <string>method_name</string> </key>
-            <value> <string>getAggregateRelatedValueList</string> </value>
+            <value> <string>Transfer_getPaymentTransactionList</string> </value>
         </item>
       </dictionary>
     </pickle>

Modified: erp5/trunk/bt5/erp5_accounting_l10n_fr_m9/SkinTemplateItem/portal_skins/erp5_accounting_l10n_fr_m9/Transfer_viewTransferReportSection/listbox.xml
URL: http://svn.erp5.org/erp5/trunk/bt5/erp5_accounting_l10n_fr_m9/SkinTemplateItem/portal_skins/erp5_accounting_l10n_fr_m9/Transfer_viewTransferReportSection/listbox.xml?rev=13126&r1=13125&r2=13126&view=diff
==============================================================================
--- erp5/trunk/bt5/erp5_accounting_l10n_fr_m9/SkinTemplateItem/portal_skins/erp5_accounting_l10n_fr_m9/Transfer_viewTransferReportSection/listbox.xml (original)
+++ erp5/trunk/bt5/erp5_accounting_l10n_fr_m9/SkinTemplateItem/portal_skins/erp5_accounting_l10n_fr_m9/Transfer_viewTransferReportSection/listbox.xml Thu Mar  1 13:46:53 2007
@@ -562,7 +562,7 @@
       <dictionary>
         <item>
             <key> <string>method_name</string> </key>
-            <value> <string>getAggregateRelatedValueList</string> </value>
+            <value> <string>Transfer_getPaymentTransactionList</string> </value>
         </item>
       </dictionary>
     </pickle>

Modified: erp5/trunk/bt5/erp5_accounting_l10n_fr_m9/bt/revision
URL: http://svn.erp5.org/erp5/trunk/bt5/erp5_accounting_l10n_fr_m9/bt/revision?rev=13126&r1=13125&r2=13126&view=diff
==============================================================================
--- erp5/trunk/bt5/erp5_accounting_l10n_fr_m9/bt/revision (original)
+++ erp5/trunk/bt5/erp5_accounting_l10n_fr_m9/bt/revision Thu Mar  1 13:46:53 2007
@@ -1,1 +1,1 @@
-80
+78




More information about the Erp5-report mailing list