From 032b7ae0f5a75ce462ea0e5f6a9f4748b0de7333 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?J=C3=A9rome=20Perrin?= <jerome@nexedi.com>
Date: Thu, 30 Nov 2006 18:45:42 +0000
Subject: [PATCH] InvoiceTransmissionSheet_viewRelatedPaymentTransactionList:  
 set the list action link to the accounting module showing all payments
 InvoiceTransmissionSheet_getRelatedPaymentTransactionList:   use a request
 cache, because the list action URL will call the list method again

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@11563 20353a03-c40f-0410-a6d1-a30d3c3de9de
---
 ...Sheet_getRelatedPaymentTransactionList.xml | 13 ++++++--
 .../listbox.xml                               | 33 +++++++++++++++++--
 bt5/erp5_accounting_l10n_fr_m9/bt/revision    |  2 +-
 3 files changed, 42 insertions(+), 6 deletions(-)

diff --git a/bt5/erp5_accounting_l10n_fr_m9/SkinTemplateItem/portal_skins/erp5_accounting_l10n_fr_m9/InvoiceTransmissionSheet_getRelatedPaymentTransactionList.xml b/bt5/erp5_accounting_l10n_fr_m9/SkinTemplateItem/portal_skins/erp5_accounting_l10n_fr_m9/InvoiceTransmissionSheet_getRelatedPaymentTransactionList.xml
index 0605607dbf..6b609aef90 100644
--- a/bt5/erp5_accounting_l10n_fr_m9/SkinTemplateItem/portal_skins/erp5_accounting_l10n_fr_m9/InvoiceTransmissionSheet_getRelatedPaymentTransactionList.xml
+++ b/bt5/erp5_accounting_l10n_fr_m9/SkinTemplateItem/portal_skins/erp5_accounting_l10n_fr_m9/InvoiceTransmissionSheet_getRelatedPaymentTransactionList.xml
@@ -71,13 +71,17 @@
             <value> <string>"""Returns a list of payment transactions related to invoice "contained" by\n
 this transmission sheet.\n
 """\n
-\n
+cached_result = context.REQUEST.other.get(script.getId())\n
+if cached_result:\n
+  return cached_result\n
+  \n
 related_payment_transaction_list = []\n
 for invoice in context.getAggregateRelatedValueList(\n
           portal_type=context.getPortalInvoiceTypeList()):\n
   related_payment_transaction_list.extend(\n
     invoice.getCausalityRelatedValueList(portal_type=\'Payment Transaction\'))\n
 \n
+context.REQUEST.other[script.getId()] = related_payment_transaction_list\n
 return related_payment_transaction_list\n
 </string> </value>
         </item>
@@ -122,11 +126,14 @@ return related_payment_transaction_list\n
                         <value>
                           <tuple>
                             <string>kw</string>
-                            <string>related_payment_transaction_list</string>
-                            <string>_getiter_</string>
                             <string>_getattr_</string>
                             <string>context</string>
+                            <string>script</string>
+                            <string>cached_result</string>
+                            <string>related_payment_transaction_list</string>
+                            <string>_getiter_</string>
                             <string>invoice</string>
+                            <string>_write_</string>
                           </tuple>
                         </value>
                     </item>
diff --git a/bt5/erp5_accounting_l10n_fr_m9/SkinTemplateItem/portal_skins/erp5_accounting_l10n_fr_m9/InvoiceTransmissionSheet_viewRelatedPaymentTransactionList/listbox.xml b/bt5/erp5_accounting_l10n_fr_m9/SkinTemplateItem/portal_skins/erp5_accounting_l10n_fr_m9/InvoiceTransmissionSheet_viewRelatedPaymentTransactionList/listbox.xml
index f3271b4b1d..2efbbee299 100644
--- a/bt5/erp5_accounting_l10n_fr_m9/SkinTemplateItem/portal_skins/erp5_accounting_l10n_fr_m9/InvoiceTransmissionSheet_viewRelatedPaymentTransactionList/listbox.xml
+++ b/bt5/erp5_accounting_l10n_fr_m9/SkinTemplateItem/portal_skins/erp5_accounting_l10n_fr_m9/InvoiceTransmissionSheet_viewRelatedPaymentTransactionList/listbox.xml
@@ -248,7 +248,9 @@
                 </item>
                 <item>
                     <key> <string>list_action</string> </key>
-                    <value> <string></string> </value>
+                    <value>
+                      <persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
+                    </value>
                 </item>
                 <item>
                     <key> <string>list_method</string> </key>
@@ -258,6 +260,10 @@
                     <key> <string>meta_types</string> </key>
                     <value> <string></string> </value>
                 </item>
+                <item>
+                    <key> <string>page_template</string> </key>
+                    <value> <string></string> </value>
+                </item>
                 <item>
                     <key> <string>portal_types</string> </key>
                     <value> <string></string> </value>
@@ -456,7 +462,7 @@
                 <item>
                     <key> <string>list_method</string> </key>
                     <value>
-                      <persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
+                      <persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent>
                     </value>
                 </item>
                 <item>
@@ -542,6 +548,29 @@
     </pickle>
   </record>
   <record id="2" aka="AAAAAAAAAAI=">
+    <pickle>
+      <tuple>
+        <tuple>
+          <string>Products.Formulator.TALESField</string>
+          <string>TALESMethod</string>
+        </tuple>
+        <none/>
+      </tuple>
+    </pickle>
+    <pickle>
+      <dictionary>
+        <item>
+            <key> <string>_text</string> </key>
+            <value> <string encoding="cdata"><![CDATA[
+
+python:"accounting_module/view?reset:int=1&" + modules[\'ZTUtils\'].make_query(uid=[x.getUid() for x in here.InvoiceTransmissionSheet_getRelatedPaymentTransactionList()])
+
+]]></string> </value>
+        </item>
+      </dictionary>
+    </pickle>
+  </record>
+  <record id="3" aka="AAAAAAAAAAM=">
     <pickle>
       <tuple>
         <tuple>
diff --git a/bt5/erp5_accounting_l10n_fr_m9/bt/revision b/bt5/erp5_accounting_l10n_fr_m9/bt/revision
index 6139554210..8783e30511 100644
--- a/bt5/erp5_accounting_l10n_fr_m9/bt/revision
+++ b/bt5/erp5_accounting_l10n_fr_m9/bt/revision
@@ -1 +1 @@
-52
\ No newline at end of file
+53
\ No newline at end of file
-- 
2.30.9