From 998ed999f39bc603bf571e5592f337d811d9409e Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Aur=C3=A9lien=20Calonne?= <aurel@nexedi.com>
Date: Fri, 20 Apr 2007 12:17:41 +0000
Subject: [PATCH] fix some field default + some other fixes

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@14141 20353a03-c40f-0410-a6d1-a30d3c3de9de
---
 .../erp5_banking_core/BankingOperationLine_init.xml         | 4 +---
 .../Baobab_getPortalReferenceCurrencyID.xml                 | 6 ++++++
 .../Baobab_getUserAssignedFunctionList.xml                  | 2 +-
 .../erp5_banking_core/Base_getPreviousState.xml             | 1 -
 .../CheckOperationLine_view/my_source_payment_reference.xml | 2 +-
 .../Checkbook_view/my_destination_payment_reference.xml     | 2 +-
 .../CounterModule_getVaultTransactionList.xml               | 5 ++++-
 .../CurrencyExchangeLine_view/my_base_price.xml             | 2 +-
 .../my_destination_payment_reference.xml                    | 2 +-
 bt5/erp5_banking_core/bt/revision                           | 2 +-
 10 files changed, 17 insertions(+), 11 deletions(-)

diff --git a/bt5/erp5_banking_core/SkinTemplateItem/portal_skins/erp5_banking_core/BankingOperationLine_init.xml b/bt5/erp5_banking_core/SkinTemplateItem/portal_skins/erp5_banking_core/BankingOperationLine_init.xml
index 2d91e28cb2..869df45291 100644
--- a/bt5/erp5_banking_core/SkinTemplateItem/portal_skins/erp5_banking_core/BankingOperationLine_init.xml
+++ b/bt5/erp5_banking_core/SkinTemplateItem/portal_skins/erp5_banking_core/BankingOperationLine_init.xml
@@ -96,9 +96,7 @@
         <item>
             <key> <string>_proxy_roles</string> </key>
             <value>
-              <tuple>
-                <string>Manager</string>
-              </tuple>
+              <tuple/>
             </value>
         </item>
         <item>
diff --git a/bt5/erp5_banking_core/SkinTemplateItem/portal_skins/erp5_banking_core/Baobab_getPortalReferenceCurrencyID.xml b/bt5/erp5_banking_core/SkinTemplateItem/portal_skins/erp5_banking_core/Baobab_getPortalReferenceCurrencyID.xml
index b4bff5efbe..d0c8724d57 100644
--- a/bt5/erp5_banking_core/SkinTemplateItem/portal_skins/erp5_banking_core/Baobab_getPortalReferenceCurrencyID.xml
+++ b/bt5/erp5_banking_core/SkinTemplateItem/portal_skins/erp5_banking_core/Baobab_getPortalReferenceCurrencyID.xml
@@ -92,6 +92,12 @@ return context.getPortalObject().getProperty(\'reference_currency_id\')\n
             <key> <string>_params</string> </key>
             <value> <string></string> </value>
         </item>
+        <item>
+            <key> <string>_proxy_roles</string> </key>
+            <value>
+              <tuple/>
+            </value>
+        </item>
         <item>
             <key> <string>errors</string> </key>
             <value>
diff --git a/bt5/erp5_banking_core/SkinTemplateItem/portal_skins/erp5_banking_core/Baobab_getUserAssignedFunctionList.xml b/bt5/erp5_banking_core/SkinTemplateItem/portal_skins/erp5_banking_core/Baobab_getUserAssignedFunctionList.xml
index fa0b16bba7..1ac6397825 100644
--- a/bt5/erp5_banking_core/SkinTemplateItem/portal_skins/erp5_banking_core/Baobab_getUserAssignedFunctionList.xml
+++ b/bt5/erp5_banking_core/SkinTemplateItem/portal_skins/erp5_banking_core/Baobab_getUserAssignedFunctionList.xml
@@ -87,7 +87,7 @@ def getFunctionList(user_id=user_id):\n
 \n
 getFunctionList = CachingMethod(getFunctionList, id=\'Baobab_getUserAssignedFunctionList\', \n
                                 cache_factory="erp5_ui_short")\n
-return getFunctionList()\n
+return getFunctionList(user_id=user_id)\n
 
 
 ]]></string> </value>
diff --git a/bt5/erp5_banking_core/SkinTemplateItem/portal_skins/erp5_banking_core/Base_getPreviousState.xml b/bt5/erp5_banking_core/SkinTemplateItem/portal_skins/erp5_banking_core/Base_getPreviousState.xml
index 9d093d5378..09e0e0a9b4 100644
--- a/bt5/erp5_banking_core/SkinTemplateItem/portal_skins/erp5_banking_core/Base_getPreviousState.xml
+++ b/bt5/erp5_banking_core/SkinTemplateItem/portal_skins/erp5_banking_core/Base_getPreviousState.xml
@@ -72,7 +72,6 @@ previous_state = None\n
 found_given_state = 0\n
 for workflow_item in workflow_item_list:\n
   current_state = workflow_item.getProperty(\'state\')\n
-  context.log(\'current_state\',current_state)\n
   if current_state == state:\n
     found_given_state = 1\n
     continue\n
diff --git a/bt5/erp5_banking_core/SkinTemplateItem/portal_skins/erp5_banking_core/CheckOperationLine_view/my_source_payment_reference.xml b/bt5/erp5_banking_core/SkinTemplateItem/portal_skins/erp5_banking_core/CheckOperationLine_view/my_source_payment_reference.xml
index eb639a5cb1..495d068723 100644
--- a/bt5/erp5_banking_core/SkinTemplateItem/portal_skins/erp5_banking_core/CheckOperationLine_view/my_source_payment_reference.xml
+++ b/bt5/erp5_banking_core/SkinTemplateItem/portal_skins/erp5_banking_core/CheckOperationLine_view/my_source_payment_reference.xml
@@ -553,7 +553,7 @@
       <dictionary>
         <item>
             <key> <string>_text</string> </key>
-            <value> <string>python: here.getSourcePaymentValue().getInternalBankAccountNumber()</string> </value>
+            <value> <string>python: here.getSourcePaymentInternalBankAccountNumber()</string> </value>
         </item>
       </dictionary>
     </pickle>
diff --git a/bt5/erp5_banking_core/SkinTemplateItem/portal_skins/erp5_banking_core/Checkbook_view/my_destination_payment_reference.xml b/bt5/erp5_banking_core/SkinTemplateItem/portal_skins/erp5_banking_core/Checkbook_view/my_destination_payment_reference.xml
index 409c89bd5e..8143121ae3 100644
--- a/bt5/erp5_banking_core/SkinTemplateItem/portal_skins/erp5_banking_core/Checkbook_view/my_destination_payment_reference.xml
+++ b/bt5/erp5_banking_core/SkinTemplateItem/portal_skins/erp5_banking_core/Checkbook_view/my_destination_payment_reference.xml
@@ -511,7 +511,7 @@
       <dictionary>
         <item>
             <key> <string>_text</string> </key>
-            <value> <string>python: here.getDestinationPaymentValue().getInternalBankAccountNumber()</string> </value>
+            <value> <string>python: here.getDestinationPaymentInternalBankAccountNumber()</string> </value>
         </item>
       </dictionary>
     </pickle>
diff --git a/bt5/erp5_banking_core/SkinTemplateItem/portal_skins/erp5_banking_core/CounterModule_getVaultTransactionList.xml b/bt5/erp5_banking_core/SkinTemplateItem/portal_skins/erp5_banking_core/CounterModule_getVaultTransactionList.xml
index 0178a27cad..541eede8c5 100644
--- a/bt5/erp5_banking_core/SkinTemplateItem/portal_skins/erp5_banking_core/CounterModule_getVaultTransactionList.xml
+++ b/bt5/erp5_banking_core/SkinTemplateItem/portal_skins/erp5_banking_core/CounterModule_getVaultTransactionList.xml
@@ -208,6 +208,7 @@ for resource in resource_dict.keys():\n
   if current_resource_portal_type not in resource_portal_type:\n
     continue\n
   if len(resource)==3: # case of history\n
+    context.log(\'movement uid before error\',resource[2])\n
     movement = context.portal_catalog.getObject(resource[2])\n
     #context.log(\'movement\',movement)\n
     explanation_value = movement\n
@@ -231,11 +232,13 @@ for resource in resource_dict.keys():\n
     except KeyError:\n
       resource_in_vault = {\'quantity\' : 0,\'total_price\' : 0}\n
     total_quantity = resource_in_vault[\'quantity\']\n
+    total_price = resource_in_vault[\'total_price\']\n
     if banknote_quantity_divisor is not None:\n
       if current_resource_portal_type == \'Banknote\':\n
         total_quantity = round(total_quantity / banknote_quantity_divisor,0)\n
+        total_price = round(total_price / banknote_quantity_divisor,0)\n
     tmp_dict.update({\'total_quantity\' : total_quantity,\n
-        \'total_price\' : resource_in_vault[\'total_price\'],})\n
+        \'total_price\' : total_price,})\n
     if vault_report_type==\'history\':\n
       tmp_dict.update({\'date\':resource_in_vault[\'date\']})\n
     general_total_price += resource_in_vault[\'total_price\']\n
diff --git a/bt5/erp5_banking_core/SkinTemplateItem/portal_skins/erp5_banking_core/CurrencyExchangeLine_view/my_base_price.xml b/bt5/erp5_banking_core/SkinTemplateItem/portal_skins/erp5_banking_core/CurrencyExchangeLine_view/my_base_price.xml
index 7592c4b900..c010bd41dd 100644
--- a/bt5/erp5_banking_core/SkinTemplateItem/portal_skins/erp5_banking_core/CurrencyExchangeLine_view/my_base_price.xml
+++ b/bt5/erp5_banking_core/SkinTemplateItem/portal_skins/erp5_banking_core/CurrencyExchangeLine_view/my_base_price.xml
@@ -214,7 +214,7 @@
                 </item>
                 <item>
                     <key> <string>enabled</string> </key>
-                    <value> <int>0</int> </value>
+                    <value> <int>1</int> </value>
                 </item>
                 <item>
                     <key> <string>external_validator</string> </key>
diff --git a/bt5/erp5_banking_core/SkinTemplateItem/portal_skins/erp5_banking_core/Delivery_viewAccounting/my_destination_payment_reference.xml b/bt5/erp5_banking_core/SkinTemplateItem/portal_skins/erp5_banking_core/Delivery_viewAccounting/my_destination_payment_reference.xml
index cdb77d8a31..be8103c16f 100644
--- a/bt5/erp5_banking_core/SkinTemplateItem/portal_skins/erp5_banking_core/Delivery_viewAccounting/my_destination_payment_reference.xml
+++ b/bt5/erp5_banking_core/SkinTemplateItem/portal_skins/erp5_banking_core/Delivery_viewAccounting/my_destination_payment_reference.xml
@@ -511,7 +511,7 @@
       <dictionary>
         <item>
             <key> <string>_text</string> </key>
-            <value> <string>python: here.getDestinationPaymentValue().getInternalBankAccountNumber()</string> </value>
+            <value> <string>python: here.getDestinationPaymentInternalBankAccountNumber()</string> </value>
         </item>
       </dictionary>
     </pickle>
diff --git a/bt5/erp5_banking_core/bt/revision b/bt5/erp5_banking_core/bt/revision
index e0d1ea1e9a..bea0d09c49 100644
--- a/bt5/erp5_banking_core/bt/revision
+++ b/bt5/erp5_banking_core/bt/revision
@@ -1 +1 @@
-205
\ No newline at end of file
+207
\ No newline at end of file
-- 
2.30.9