From 3e6cb295c61bb02c2d210da8baeeecdee01e2eb0 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Aur=C3=A9lien=20Calonne?= <aurel@nexedi.com>
Date: Wed, 10 Oct 2007 08:26:06 +0000
Subject: [PATCH] many forms fix add script for new inventory computation
 method

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@16924 20353a03-c40f-0410-a6d1-a30d3c3de9de
---
 .../listbox.xml                               |   2 +-
 ...ory_getDefaultInventoryCalculationList.xml | 162 ++++++++++
 .../BankAccountInventory_view.xml             |   4 +-
 .../listbox_destination_payment_reference.xml | 287 ++++++++++++++++++
 .../CashInventoryLine_view/my_total_price.xml |  20 +-
 .../listbox.xml                               |   4 +
 .../CashInventory_view/my_destination.xml     |   2 +-
 .../CashInventory_viewLineFastInputDialog.xml |   2 +-
 bt5/erp5_banking_inventory/bt/revision        |   2 +-
 9 files changed, 479 insertions(+), 6 deletions(-)
 create mode 100644 bt5/erp5_banking_inventory/SkinTemplateItem/portal_skins/erp5_banking_inventory/BankAccountInventory_getDefaultInventoryCalculationList.xml
 create mode 100644 bt5/erp5_banking_inventory/SkinTemplateItem/portal_skins/erp5_banking_inventory/BankAccountInventory_view/listbox_destination_payment_reference.xml

diff --git a/bt5/erp5_banking_inventory/SkinTemplateItem/portal_skins/erp5_banking_inventory/BankAccountInventoryModule_viewBankAccountInventory/listbox.xml b/bt5/erp5_banking_inventory/SkinTemplateItem/portal_skins/erp5_banking_inventory/BankAccountInventoryModule_viewBankAccountInventory/listbox.xml
index b2bdc6224f..339eef1ed2 100644
--- a/bt5/erp5_banking_inventory/SkinTemplateItem/portal_skins/erp5_banking_inventory/BankAccountInventoryModule_viewBankAccountInventory/listbox.xml
+++ b/bt5/erp5_banking_inventory/SkinTemplateItem/portal_skins/erp5_banking_inventory/BankAccountInventoryModule_viewBankAccountInventory/listbox.xml
@@ -440,7 +440,7 @@
                 </item>
                 <item>
                     <key> <string>selection_name</string> </key>
-                    <value> <string>bank_account_inventory_selection</string> </value>
+                    <value> <string>bank_account_inventory_module_selection</string> </value>
                 </item>
                 <item>
                     <key> <string>sort</string> </key>
diff --git a/bt5/erp5_banking_inventory/SkinTemplateItem/portal_skins/erp5_banking_inventory/BankAccountInventory_getDefaultInventoryCalculationList.xml b/bt5/erp5_banking_inventory/SkinTemplateItem/portal_skins/erp5_banking_inventory/BankAccountInventory_getDefaultInventoryCalculationList.xml
new file mode 100644
index 0000000000..de9808c413
--- /dev/null
+++ b/bt5/erp5_banking_inventory/SkinTemplateItem/portal_skins/erp5_banking_inventory/BankAccountInventory_getDefaultInventoryCalculationList.xml
@@ -0,0 +1,162 @@
+<?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>default_inventory_calculation_list = ({ "inventory_params" : {"node" : context.getDestination(),\n
+                                                                      "group_by_payment" : 1,\n
+                                                                      "group_by_resource" : 1,\n
+                                                                      },\n
+                                        "list_method" : "getMovementList",\n
+                                        "first_level" : ({\'key\' : \'resource_relative_url\',\n
+                                                          \'getter\' : \'getResource\',\n
+                                                          \'setter\' : ("appendToCategoryList", "resource")},\n
+                                                         {\'key\' : \'payment_uid\',\n
+                                                          \'getter\' : \'getDestinationPaymentUid\',\n
+                                                          \'setter\' : ("appendToCategoryListFromUid", "destination_payment")},\n
+                                                         ),\n
+                                        },\n
+                                      )\n
+\n
+return default_inventory_calculation_list\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></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>_getattr_</string>
+<string>context</string>
+                            <string>default_inventory_calculation_list</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>BankAccountInventory_getDefaultInventoryCalculationList</string> </value>
+        </item>
+        <item>
+            <key> <string>warnings</string> </key>
+            <value>
+              <tuple/>
+            </value>
+        </item>
+      </dictionary>
+    </pickle>
+  </record>
+</ZopeData>
diff --git a/bt5/erp5_banking_inventory/SkinTemplateItem/portal_skins/erp5_banking_inventory/BankAccountInventory_view.xml b/bt5/erp5_banking_inventory/SkinTemplateItem/portal_skins/erp5_banking_inventory/BankAccountInventory_view.xml
index eaf3b2903a..8348dd655a 100644
--- a/bt5/erp5_banking_inventory/SkinTemplateItem/portal_skins/erp5_banking_inventory/BankAccountInventory_view.xml
+++ b/bt5/erp5_banking_inventory/SkinTemplateItem/portal_skins/erp5_banking_inventory/BankAccountInventory_view.xml
@@ -95,7 +95,9 @@
                 <item>
                     <key> <string>hidden</string> </key>
                     <value>
-                      <list/>
+                      <list>
+                        <string>listbox_destination_payment_reference</string>
+                      </list>
                     </value>
                 </item>
                 <item>
diff --git a/bt5/erp5_banking_inventory/SkinTemplateItem/portal_skins/erp5_banking_inventory/BankAccountInventory_view/listbox_destination_payment_reference.xml b/bt5/erp5_banking_inventory/SkinTemplateItem/portal_skins/erp5_banking_inventory/BankAccountInventory_view/listbox_destination_payment_reference.xml
new file mode 100644
index 0000000000..d5a0fb021c
--- /dev/null
+++ b/bt5/erp5_banking_inventory/SkinTemplateItem/portal_skins/erp5_banking_inventory/BankAccountInventory_view/listbox_destination_payment_reference.xml
@@ -0,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_reference</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>20</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>listbox_destination_payment_reference</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>
diff --git a/bt5/erp5_banking_inventory/SkinTemplateItem/portal_skins/erp5_banking_inventory/CashInventoryLine_view/my_total_price.xml b/bt5/erp5_banking_inventory/SkinTemplateItem/portal_skins/erp5_banking_inventory/CashInventoryLine_view/my_total_price.xml
index e7845f360b..38f8336ce2 100644
--- a/bt5/erp5_banking_inventory/SkinTemplateItem/portal_skins/erp5_banking_inventory/CashInventoryLine_view/my_total_price.xml
+++ b/bt5/erp5_banking_inventory/SkinTemplateItem/portal_skins/erp5_banking_inventory/CashInventoryLine_view/my_total_price.xml
@@ -123,7 +123,9 @@
                 </item>
                 <item>
                     <key> <string>default</string> </key>
-                    <value> <string></string> </value>
+                    <value>
+                      <persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
+                    </value>
                 </item>
                 <item>
                     <key> <string>description</string> </key>
@@ -254,4 +256,20 @@
       </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: here.getTotalPrice(fast=0)</string> </value>
+        </item>
+      </dictionary>
+    </pickle>
+  </record>
 </ZopeData>
diff --git a/bt5/erp5_banking_inventory/SkinTemplateItem/portal_skins/erp5_banking_inventory/CashInventoryModule_viewCashInventoryGroup/listbox.xml b/bt5/erp5_banking_inventory/SkinTemplateItem/portal_skins/erp5_banking_inventory/CashInventoryModule_viewCashInventoryGroup/listbox.xml
index 6408d7f992..a4448964f2 100644
--- a/bt5/erp5_banking_inventory/SkinTemplateItem/portal_skins/erp5_banking_inventory/CashInventoryModule_viewCashInventoryGroup/listbox.xml
+++ b/bt5/erp5_banking_inventory/SkinTemplateItem/portal_skins/erp5_banking_inventory/CashInventoryModule_viewCashInventoryGroup/listbox.xml
@@ -300,6 +300,10 @@
                     <key> <string>columns</string> </key>
                     <value>
                       <list>
+                        <tuple>
+                          <string>id</string>
+                          <string>Id</string>
+                        </tuple>
                         <tuple>
                           <string>title</string>
                           <string>Title</string>
diff --git a/bt5/erp5_banking_inventory/SkinTemplateItem/portal_skins/erp5_banking_inventory/CashInventory_view/my_destination.xml b/bt5/erp5_banking_inventory/SkinTemplateItem/portal_skins/erp5_banking_inventory/CashInventory_view/my_destination.xml
index ac16b71079..76baffe644 100644
--- a/bt5/erp5_banking_inventory/SkinTemplateItem/portal_skins/erp5_banking_inventory/CashInventory_view/my_destination.xml
+++ b/bt5/erp5_banking_inventory/SkinTemplateItem/portal_skins/erp5_banking_inventory/CashInventory_view/my_destination.xml
@@ -281,7 +281,7 @@
       <dictionary>
         <item>
             <key> <string>_text</string> </key>
-            <value> <string>python: here.Delivery_getVaultItemList(all=1,user_site=0,base_site=here.Baobab_getUserAssignedRootSiteList()[0],vault_type=\'site\',leaf_node=0)</string> </value>
+            <value> <string>python: here.Delivery_getVaultItemList(all=1,user_site=0,base_site=here.Baobab_getUserAssignedRootSiteList()[0],vault_type=\'site\',leaf_node=0, current_url=here.getDestination())</string> </value>
         </item>
       </dictionary>
     </pickle>
diff --git a/bt5/erp5_banking_inventory/SkinTemplateItem/portal_skins/erp5_banking_inventory/CashInventory_viewLineFastInputDialog.xml b/bt5/erp5_banking_inventory/SkinTemplateItem/portal_skins/erp5_banking_inventory/CashInventory_viewLineFastInputDialog.xml
index 867bbaa86a..87dcd31035 100644
--- a/bt5/erp5_banking_inventory/SkinTemplateItem/portal_skins/erp5_banking_inventory/CashInventory_viewLineFastInputDialog.xml
+++ b/bt5/erp5_banking_inventory/SkinTemplateItem/portal_skins/erp5_banking_inventory/CashInventory_viewLineFastInputDialog.xml
@@ -86,7 +86,7 @@ if redirect_url is not None:\n
 \n
 if currency_id == context.Baobab_getPortalReferenceCurrencyID():\n
   letter_list      = None\n
-  variation_list   = None\n
+  variation_list   = context.Baobab_getResourceVintageList(coin=1, banknote=1)\n
   cash_status_list = None\n
 else:\n
   letter_list      = [\'not_defined\']\n
diff --git a/bt5/erp5_banking_inventory/bt/revision b/bt5/erp5_banking_inventory/bt/revision
index 9a037142aa..9d607966b7 100644
--- a/bt5/erp5_banking_inventory/bt/revision
+++ b/bt5/erp5_banking_inventory/bt/revision
@@ -1 +1 @@
-10
\ No newline at end of file
+11
\ No newline at end of file
-- 
2.30.9