[Erp5-report] r12446 - in /erp5/trunk/bt5/erp5_banking_cash: SkinTemplateItem/portal_skins/...

nobody at svn.erp5.org nobody at svn.erp5.org
Tue Jan 30 10:18:51 CET 2007


Author: seb
Date: Tue Jan 30 10:18:37 2007
New Revision: 12446

URL: http://svn.erp5.org?rev=12446&view=rev
Log:
many changes on account incident because specification has changed.
Fixed security problem on currency sale

Added:
    erp5/trunk/bt5/erp5_banking_cash/SkinTemplateItem/portal_skins/erp5_banking_cash/CashIncident_view/my_resource_title.xml
    erp5/trunk/bt5/erp5_banking_cash/SkinTemplateItem/portal_skins/erp5_banking_cash/OutgoingCashIncidentLine_getBaobabSource.xml
    erp5/trunk/bt5/erp5_banking_cash/WorkflowTemplateItem/portal_workflow/account_incident_workflow/scripts/checkConsistencyAndValidatePositionAccounting.xml
Modified:
    erp5/trunk/bt5/erp5_banking_cash/SkinTemplateItem/portal_skins/erp5_banking_cash/CashIncident_view.xml
    erp5/trunk/bt5/erp5_banking_cash/SkinTemplateItem/portal_skins/erp5_banking_cash/CashIncident_viewIncomingLineFastInputDialog.xml
    erp5/trunk/bt5/erp5_banking_cash/SkinTemplateItem/portal_skins/erp5_banking_cash/CashIncident_viewOutgoingLineFastInputDialog.xml
    erp5/trunk/bt5/erp5_banking_cash/SkinTemplateItem/portal_skins/erp5_banking_cash/CurrencySale_getBaobabSource.xml
    erp5/trunk/bt5/erp5_banking_cash/SkinTemplateItem/portal_skins/erp5_banking_cash/DestructionSurveyModule_viewDestructionSurveyList/listbox.xml
    erp5/trunk/bt5/erp5_banking_cash/SkinTemplateItem/portal_skins/erp5_banking_cash/MonetarySurveyModule_viewMonetarySurveyList/listbox.xml
    erp5/trunk/bt5/erp5_banking_cash/SkinTemplateItem/portal_skins/erp5_banking_cash/OutgoingCashIncidentLine_getBaobabDestination.xml
    erp5/trunk/bt5/erp5_banking_cash/WorkflowTemplateItem/portal_workflow/account_incident_workflow/transitions/confirm.xml
    erp5/trunk/bt5/erp5_banking_cash/WorkflowTemplateItem/portal_workflow/account_incident_workflow/transitions/confirm_action.xml
    erp5/trunk/bt5/erp5_banking_cash/WorkflowTemplateItem/portal_workflow/cash_incident_workflow/transitions/deliver.xml
    erp5/trunk/bt5/erp5_banking_cash/WorkflowTemplateItem/portal_workflow/usual_cash_transfer_workflow/scripts/validateVaultBalance.xml
    erp5/trunk/bt5/erp5_banking_cash/bt/revision

Modified: erp5/trunk/bt5/erp5_banking_cash/SkinTemplateItem/portal_skins/erp5_banking_cash/CashIncident_view.xml
URL: http://svn.erp5.org/erp5/trunk/bt5/erp5_banking_cash/SkinTemplateItem/portal_skins/erp5_banking_cash/CashIncident_view.xml?rev=12446&r1=12445&r2=12446&view=diff
==============================================================================
--- erp5/trunk/bt5/erp5_banking_cash/SkinTemplateItem/portal_skins/erp5_banking_cash/CashIncident_view.xml (original)
+++ erp5/trunk/bt5/erp5_banking_cash/SkinTemplateItem/portal_skins/erp5_banking_cash/CashIncident_view.xml Tue Jan 30 10:18:37 2007
@@ -108,6 +108,7 @@
                         <string>my_source_decision_title</string>
                         <string>my_responsible_title</string>
                         <string>my_source_total_asset_price</string>
+                        <string>my_resource_title</string>
                       </list>
                     </value>
                 </item>

Added: erp5/trunk/bt5/erp5_banking_cash/SkinTemplateItem/portal_skins/erp5_banking_cash/CashIncident_view/my_resource_title.xml
URL: http://svn.erp5.org/erp5/trunk/bt5/erp5_banking_cash/SkinTemplateItem/portal_skins/erp5_banking_cash/CashIncident_view/my_resource_title.xml?rev=12446&view=auto
==============================================================================
--- erp5/trunk/bt5/erp5_banking_cash/SkinTemplateItem/portal_skins/erp5_banking_cash/CashIncident_view/my_resource_title.xml (added)
+++ erp5/trunk/bt5/erp5_banking_cash/SkinTemplateItem/portal_skins/erp5_banking_cash/CashIncident_view/my_resource_title.xml Tue Jan 30 10:18:37 2007
@@ -1,0 +1,272 @@
+<?xml version="1.0"?>
+<ZopeData>
+  <record id="1" aka="AAAAAAAAAAE=">
+    <pickle>
+      <tuple>
+        <tuple>
+          <string>Products.Formulator.StandardFields</string>
+          <string>StringField</string>
+        </tuple>
+        <none/>
+      </tuple>
+    </pickle>
+    <pickle>
+      <dictionary>
+        <item>
+            <key> <string>_owner</string> </key>
+            <value>
+              <none/>
+            </value>
+        </item>
+        <item>
+            <key> <string>id</string> </key>
+            <value> <string>my_resource_title</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> <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>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>Currency</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>
+</ZopeData>

Modified: erp5/trunk/bt5/erp5_banking_cash/SkinTemplateItem/portal_skins/erp5_banking_cash/CashIncident_viewIncomingLineFastInputDialog.xml
URL: http://svn.erp5.org/erp5/trunk/bt5/erp5_banking_cash/SkinTemplateItem/portal_skins/erp5_banking_cash/CashIncident_viewIncomingLineFastInputDialog.xml?rev=12446&r1=12445&r2=12446&view=diff
==============================================================================
--- erp5/trunk/bt5/erp5_banking_cash/SkinTemplateItem/portal_skins/erp5_banking_cash/CashIncident_viewIncomingLineFastInputDialog.xml (original)
+++ erp5/trunk/bt5/erp5_banking_cash/SkinTemplateItem/portal_skins/erp5_banking_cash/CashIncident_viewIncomingLineFastInputDialog.xml Tue Jan 30 10:18:37 2007
@@ -69,12 +69,22 @@
         <item>
             <key> <string>_body</string> </key>
             <value> <string>request = context.REQUEST\n
+currency = context.getResourceId()\n
+\n
+if currency != context.Baobab_getPortalReferenceCurrencyID():\n
+  cash_status = [\'not_defined\']\n
+  emission_letter = [\'not_defined\']\n
+  variation = [\'not_defined\']\n
+else:\n
+  cash_status = None\n
+  emission_letter = None\n
+  variation = context.Baobab_getResourceVintageList(banknote=1, coin=1)\n
 \n
 cash_detail_dict = {\'line_portal_type\'           : \'Incoming Cash Incident Line\'\n
-                    , \'operation_currency\'       : context.Baobab_getPortalReferenceCurrencyID()\n
-                    , \'cash_status_list\'         : None\n
-                    , \'emission_letter_list\'     : None\n
-                    , \'variation_list\'           : context.Baobab_getResourceVintageList(banknote=1, coin=1)\n
+                    , \'operation_currency\'       : currency\n
+                    , \'cash_status_list\'         : cash_status\n
+                    , \'emission_letter_list\'     : emission_letter\n
+                    , \'variation_list\'           : variation\n
                     , \'currency_cash_portal_type\': None\n
                     , \'read_only\'                : False\n
                     , \'column_base_category\'     : \'variation\'\n
@@ -135,6 +145,10 @@
                             <string>_getattr_</string>
                             <string>context</string>
                             <string>request</string>
+                            <string>currency</string>
+                            <string>cash_status</string>
+                            <string>emission_letter</string>
+                            <string>variation</string>
                             <string>None</string>
                             <string>False</string>
                             <string>cash_detail_dict</string>

Modified: erp5/trunk/bt5/erp5_banking_cash/SkinTemplateItem/portal_skins/erp5_banking_cash/CashIncident_viewOutgoingLineFastInputDialog.xml
URL: http://svn.erp5.org/erp5/trunk/bt5/erp5_banking_cash/SkinTemplateItem/portal_skins/erp5_banking_cash/CashIncident_viewOutgoingLineFastInputDialog.xml?rev=12446&r1=12445&r2=12446&view=diff
==============================================================================
--- erp5/trunk/bt5/erp5_banking_cash/SkinTemplateItem/portal_skins/erp5_banking_cash/CashIncident_viewOutgoingLineFastInputDialog.xml (original)
+++ erp5/trunk/bt5/erp5_banking_cash/SkinTemplateItem/portal_skins/erp5_banking_cash/CashIncident_viewOutgoingLineFastInputDialog.xml Tue Jan 30 10:18:37 2007
@@ -69,12 +69,22 @@
         <item>
             <key> <string>_body</string> </key>
             <value> <string>request = context.REQUEST\n
+currency = context.getResourceId()\n
+\n
+if currency != context.Baobab_getPortalReferenceCurrencyID():\n
+  cash_status = [\'not_defined\']\n
+  emission_letter = [\'not_defined\']\n
+  variation = [\'not_defined\']\n
+else:\n
+  cash_status = None\n
+  emission_letter = None\n
+  variation = context.Baobab_getResourceVintageList(banknote=1, coin=1)\n
 \n
 cash_detail_dict = {\'line_portal_type\'           : \'Outgoing Cash Incident Line\'\n
-                    , \'operation_currency\'       : context.Baobab_getPortalReferenceCurrencyID()\n
-                    , \'cash_status_list\'         : None\n
-                    , \'emission_letter_list\'     : None\n
-                    , \'variation_list\'           : context.Baobab_getResourceVintageList(banknote=1, coin=1)\n
+                    , \'operation_currency\'       : currency\n
+                    , \'cash_status_list\'         : cash_status\n
+                    , \'emission_letter_list\'     : emission_letter\n
+                    , \'variation_list\'           : variation\n
                     , \'currency_cash_portal_type\': None\n
                     , \'read_only\'                : False\n
                     , \'column_base_category\'     : \'variation\'\n
@@ -135,6 +145,10 @@
                             <string>_getattr_</string>
                             <string>context</string>
                             <string>request</string>
+                            <string>currency</string>
+                            <string>cash_status</string>
+                            <string>emission_letter</string>
+                            <string>variation</string>
                             <string>None</string>
                             <string>False</string>
                             <string>cash_detail_dict</string>

Modified: erp5/trunk/bt5/erp5_banking_cash/SkinTemplateItem/portal_skins/erp5_banking_cash/CurrencySale_getBaobabSource.xml
URL: http://svn.erp5.org/erp5/trunk/bt5/erp5_banking_cash/SkinTemplateItem/portal_skins/erp5_banking_cash/CurrencySale_getBaobabSource.xml?rev=12446&r1=12445&r2=12446&view=diff
==============================================================================
--- erp5/trunk/bt5/erp5_banking_cash/SkinTemplateItem/portal_skins/erp5_banking_cash/CurrencySale_getBaobabSource.xml (original)
+++ erp5/trunk/bt5/erp5_banking_cash/SkinTemplateItem/portal_skins/erp5_banking_cash/CurrencySale_getBaobabSource.xml Tue Jan 30 10:18:37 2007
@@ -86,27 +86,28 @@
 baobab_source = None\n
 \n
 # Get the history of the workflow\n
-user_id=\'None\'\n
+user_id=None\n
 \n
 for workflow_item in context.Base_getWorkflowHistoryItemList(\'currency_sale_workflow\',display=0):\n
   \n
   if workflow_item.getProperty(\'action\')==\'deliver_action\':\n
     user_id=workflow_item.getProperty(\'actor\')\n
 \n
-site_list = context.Baobab_getUserAssignedSiteList(user_id=user_id)\n
-\n
-for site in site_list:\n
-  site_value = context.portal_categories.getCategoryValue(site)\n
-  \n
-  if site_value.getVaultType().endswith(\'guichet\') and source in site:\n
-    baobab_source = site + encaisse_devise\n
-    found = 1\n
+if user_id is not None:\n
+  site_list = context.Baobab_getUserAssignedSiteList(user_id=user_id)\n
+\n
+  for site in site_list:\n
+    site_value = context.portal_categories.getCategoryValue(site)\n
     \n
-    break\n
-\n
-  if not found:\n
-    msg = Message(domain=\'ui\', message=\'Your user is not well assigned\')\n
-    raise ValidationFailed, (msg,)\n
+    if site_value.getVaultType().endswith(\'guichet\') and source in site:\n
+      baobab_source = site + encaisse_devise\n
+      found = 1\n
+      \n
+      break\n
+\n
+    if not found:\n
+      msg = Message(domain=\'ui\', message=\'Your user is not well assigned\')\n
+      raise ValidationFailed, (msg,)\n
 \n
 return baobab_source\n
 </string> </value>

Modified: erp5/trunk/bt5/erp5_banking_cash/SkinTemplateItem/portal_skins/erp5_banking_cash/DestructionSurveyModule_viewDestructionSurveyList/listbox.xml
URL: http://svn.erp5.org/erp5/trunk/bt5/erp5_banking_cash/SkinTemplateItem/portal_skins/erp5_banking_cash/DestructionSurveyModule_viewDestructionSurveyList/listbox.xml?rev=12446&r1=12445&r2=12446&view=diff
==============================================================================
--- erp5/trunk/bt5/erp5_banking_cash/SkinTemplateItem/portal_skins/erp5_banking_cash/DestructionSurveyModule_viewDestructionSurveyList/listbox.xml (original)
+++ erp5/trunk/bt5/erp5_banking_cash/SkinTemplateItem/portal_skins/erp5_banking_cash/DestructionSurveyModule_viewDestructionSurveyList/listbox.xml Tue Jan 30 10:18:37 2007
@@ -335,7 +335,7 @@
                         </tuple>
                         <tuple>
                           <string>source_reference</string>
-                          <string encoding="base64">UsOpZsOpcmVuY2U=</string>
+                          <string>Reference</string>
                         </tuple>
                         <tuple>
                           <string>delivery.start_date</string>

Modified: erp5/trunk/bt5/erp5_banking_cash/SkinTemplateItem/portal_skins/erp5_banking_cash/MonetarySurveyModule_viewMonetarySurveyList/listbox.xml
URL: http://svn.erp5.org/erp5/trunk/bt5/erp5_banking_cash/SkinTemplateItem/portal_skins/erp5_banking_cash/MonetarySurveyModule_viewMonetarySurveyList/listbox.xml?rev=12446&r1=12445&r2=12446&view=diff
==============================================================================
--- erp5/trunk/bt5/erp5_banking_cash/SkinTemplateItem/portal_skins/erp5_banking_cash/MonetarySurveyModule_viewMonetarySurveyList/listbox.xml (original)
+++ erp5/trunk/bt5/erp5_banking_cash/SkinTemplateItem/portal_skins/erp5_banking_cash/MonetarySurveyModule_viewMonetarySurveyList/listbox.xml Tue Jan 30 10:18:37 2007
@@ -341,7 +341,7 @@
                         </tuple>
                         <tuple>
                           <string>source_reference</string>
-                          <string encoding="base64">UsOpZsOpcmVuY2U=</string>
+                          <string>Reference</string>
                         </tuple>
                         <tuple>
                           <string>delivery.start_date</string>
@@ -452,6 +452,10 @@
                     <value>
                       <list/>
                     </value>
+                </item>
+                <item>
+                    <key> <string>page_template</string> </key>
+                    <value> <string></string> </value>
                 </item>
                 <item>
                     <key> <string>portal_types</string> </key>

Modified: erp5/trunk/bt5/erp5_banking_cash/SkinTemplateItem/portal_skins/erp5_banking_cash/OutgoingCashIncidentLine_getBaobabDestination.xml
URL: http://svn.erp5.org/erp5/trunk/bt5/erp5_banking_cash/SkinTemplateItem/portal_skins/erp5_banking_cash/OutgoingCashIncidentLine_getBaobabDestination.xml?rev=12446&r1=12445&r2=12446&view=diff
==============================================================================
--- erp5/trunk/bt5/erp5_banking_cash/SkinTemplateItem/portal_skins/erp5_banking_cash/OutgoingCashIncidentLine_getBaobabDestination.xml (original)
+++ erp5/trunk/bt5/erp5_banking_cash/SkinTemplateItem/portal_skins/erp5_banking_cash/OutgoingCashIncidentLine_getBaobabDestination.xml Tue Jan 30 10:18:37 2007
@@ -68,7 +68,8 @@
         </item>
         <item>
             <key> <string>_body</string> </key>
-            <value> <string>return None\n
+            <value> <string>#return None\n
+return context.getSource()\n
 </string> </value>
         </item>
         <item>
@@ -119,7 +120,8 @@
                           <tuple>
                             <string>args</string>
                             <string>kw</string>
-                            <string>None</string>
+                            <string>_getattr_</string>
+                            <string>context</string>
                           </tuple>
                         </value>
                     </item>

Added: erp5/trunk/bt5/erp5_banking_cash/SkinTemplateItem/portal_skins/erp5_banking_cash/OutgoingCashIncidentLine_getBaobabSource.xml
URL: http://svn.erp5.org/erp5/trunk/bt5/erp5_banking_cash/SkinTemplateItem/portal_skins/erp5_banking_cash/OutgoingCashIncidentLine_getBaobabSource.xml?rev=12446&view=auto
==============================================================================
--- erp5/trunk/bt5/erp5_banking_cash/SkinTemplateItem/portal_skins/erp5_banking_cash/OutgoingCashIncidentLine_getBaobabSource.xml (added)
+++ erp5/trunk/bt5/erp5_banking_cash/SkinTemplateItem/portal_skins/erp5_banking_cash/OutgoingCashIncidentLine_getBaobabSource.xml Tue Jan 30 10:18:37 2007
@@ -1,0 +1,150 @@
+<?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>return None\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>*args, **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>args</string>
+                            <string>kw</string>
+                            <string>None</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>OutgoingCashIncidentLine_getBaobabSource</string> </value>
+        </item>
+        <item>
+            <key> <string>warnings</string> </key>
+            <value>
+              <tuple/>
+            </value>
+        </item>
+      </dictionary>
+    </pickle>
+  </record>
+</ZopeData>

Added: erp5/trunk/bt5/erp5_banking_cash/WorkflowTemplateItem/portal_workflow/account_incident_workflow/scripts/checkConsistencyAndValidatePositionAccounting.xml
URL: http://svn.erp5.org/erp5/trunk/bt5/erp5_banking_cash/WorkflowTemplateItem/portal_workflow/account_incident_workflow/scripts/checkConsistencyAndValidatePositionAccounting.xml?rev=12446&view=auto
==============================================================================
--- erp5/trunk/bt5/erp5_banking_cash/WorkflowTemplateItem/portal_workflow/account_incident_workflow/scripts/checkConsistencyAndValidatePositionAccounting.xml (added)
+++ erp5/trunk/bt5/erp5_banking_cash/WorkflowTemplateItem/portal_workflow/account_incident_workflow/scripts/checkConsistencyAndValidatePositionAccounting.xml Tue Jan 30 10:18:37 2007
@@ -1,0 +1,267 @@
+<?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 encoding="cdata"><![CDATA[
+
+# check that we don\'t have both incoming and outgoing line on the document\n
+from Products.DCWorkflow.DCWorkflow import ValidationFailed\n
+from Products.ERP5Type.Message import Message\n
+\n
+transaction = state_change[\'object\']\n
+date = transaction.getStartDate()\n
+\n
+user_id = transaction.portal_membership.getAuthenticatedMember().getUserName()\n
+site_list = context.Baobab_getUserAssignedSiteList(user_id=user_id)\n
+# context.log(\'validateVaultBalance site_list\',site_list)\n
+source = transaction.getSource()\n
+baobab_source = None\n
+for site in site_list:\n
+  site_value = context.portal_categories.getCategoryValue(site)\n
+  if site_value.getVaultType().endswith(\'guichet\') and source in site:\n
+    baobab_source = site + \'/encaisse_des_billets_et_monnaies/entrante\'\n
+    break\n
+source = baobab_source\n
+source_object = context.portal_categories.getCategoryValue(source)\n
+\n
+# check again that we are in the good accounting date\n
+if not transaction.Baobab_checkCounterDateOpen(site=source_object, date=date):\n
+  msg = Message(domain = "ui", message="Transaction not in the good accounting date")\n
+  raise ValidationFailed, (msg,)\n
+\n
+\n
+in_list = transaction.objectValues(portal_type=\'Incoming Account Incident Line\')\n
+out_list = transaction.objectValues(portal_type=\'Outgoing Account Incident Line\')\n
+vault = "%s/surface/caisse_courante/encaisse_des_billets_et_monnaies" %(transaction.getSource(),)\n
+price = transaction.getSourceTotalAssetPrice()\n
+in_price = transaction.getTotalPrice(portal_type=[\'Incoming Account Incident Line\',\'Cash Delivery Cell\'],fast=0)\n
+out_price = transaction.getTotalPrice(portal_type=[\'Outgoing Account Incident Line\',\'Cash Delivery Cell\'],fast=0)\n
+\n
+if len(in_list) != 0 and len(out_list) != 0:\n
+  msg = Message(domain = "ui", message="You can\'t have excess and deficit on the document.")\n
+  raise ValidationFailed, (msg,)\n
+elif len(in_list) == 0 and len(out_list) == 0:\n
+  msg = Message(domain = "ui", message="No resource.")\n
+  raise ValidationFailed, (msg,)\n
+elif len(out_list) !=0:\n
+  #resource = transaction.CashDelivery_checkCounterInventory(source=vault, portal_type=\'Outgoing Account Incident Line\')\n
+  resource = transaction.CashDelivery_checkCounterInventory(source=vault, portal_type=\'Outgoing Account Incident Line\')\n
+  if resource <> 0 :\n
+    msg = Message(domain="ui", message="Insufficient Balance.")\n
+    raise ValidationFailed, (msg,)\n
+elif (in_price != 0 and in_price != price) or (out_price != 0 and out_price != price):\n
+  msg = Message(domain = "ui", message="Price differs between document and resource.")\n
+  raise ValidationFailed, (msg,)\n
+\n
+# Now we will validate the accounting position\n
+transaction = state_change[\'object\']\n
+bank_account = transaction.getDestinationPaymentValue()\n
+price = transaction.getSourceTotalAssetPrice()\n
+line = transaction.get(\'movement\')\n
+\n
+in_list = transaction.objectValues(portal_type=\'Incoming Account Incident Line\')\n
+out_list = transaction.objectValues(portal_type=\'Outgoing Account Incident Line\')\n
+\n
+debit=0\n
+if (len(in_list)!= 0):  \n
+  # This is a single currency operation, so it is not necessary to convert the price.\n
+  line.setSourceCredit(price)\n
+\n
+elif (len(out_list) != 0) :\n
+  # This is a single currency operation, so it is not necessary to convert the price.\n
+  debit=1\n
+  line.setSourceDebit(price)\n
+\n
+# this prevents multiple transactions from being committed at the same time for this bank account.\n
+bank_account.serialize()\n
+\n
+# Make sure there are no other operations pending for this account\n
+if transaction.BankAccount_isMessagePending(bank_account):\n
+  msg = Message(domain=\'ui\', message="There are operations pending for this account that prevent form calculating its position. Please try again later.")\n
+  raise ValidationFailed, (msg,)\n
+\n
+# Index the banking operation line so it impacts account position\n
+transaction.BankingOperationLine_index(line)\n
+\n
+if debit:\n
+  # Test if the account balance is sufficient.\n
+  error = transaction.BankAccount_checkAvailableBalance(bank_account.getRelativeUrl(), price)\n
+  if error[\'error_code\'] == 1:\n
+    msg = Message(domain=\'ui\', message="Bank account is not sufficient.")\n
+    raise ValidationFailed, (msg,)\n
+  elif error[\'error_code\'] == 2:\n
+    msg = Message(domain=\'ui\', message="Bank account is not valid.")\n
+    raise ValidationFailed, (msg,)\n
+  elif error[\'error_code\'] != 0:\n
+    msg = Message(domain=\'ui\', message="Unknown error code.")\n
+    raise ValidationFailed, (msg,)\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>_params</string> </key>
+            <value> <string>state_change</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>state_change</string>
+                            <string>Products.DCWorkflow.DCWorkflow</string>
+                            <string>ValidationFailed</string>
+                            <string>Products.ERP5Type.Message</string>
+                            <string>Message</string>
+                            <string>_getitem_</string>
+                            <string>transaction</string>
+                            <string>_getattr_</string>
+                            <string>date</string>
+                            <string>user_id</string>
+                            <string>context</string>
+                            <string>site_list</string>
+                            <string>source</string>
+                            <string>None</string>
+                            <string>baobab_source</string>
+                            <string>_getiter_</string>
+                            <string>site</string>
+                            <string>site_value</string>
+                            <string>source_object</string>
+                            <string>msg</string>
+                            <string>in_list</string>
+                            <string>out_list</string>
+                            <string>vault</string>
+                            <string>price</string>
+                            <string>in_price</string>
+                            <string>out_price</string>
+                            <string>len</string>
+                            <string>resource</string>
+                            <string>bank_account</string>
+                            <string>line</string>
+                            <string>debit</string>
+                            <string>error</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>checkConsistencyAndValidatePositionAccounting</string> </value>
+        </item>
+        <item>
+            <key> <string>warnings</string> </key>
+            <value>
+              <tuple/>
+            </value>
+        </item>
+      </dictionary>
+    </pickle>
+  </record>
+</ZopeData>

Modified: erp5/trunk/bt5/erp5_banking_cash/WorkflowTemplateItem/portal_workflow/account_incident_workflow/transitions/confirm.xml
URL: http://svn.erp5.org/erp5/trunk/bt5/erp5_banking_cash/WorkflowTemplateItem/portal_workflow/account_incident_workflow/transitions/confirm.xml?rev=12446&r1=12445&r2=12446&view=diff
==============================================================================
--- erp5/trunk/bt5/erp5_banking_cash/WorkflowTemplateItem/portal_workflow/account_incident_workflow/transitions/confirm.xml (original)
+++ erp5/trunk/bt5/erp5_banking_cash/WorkflowTemplateItem/portal_workflow/account_incident_workflow/transitions/confirm.xml Tue Jan 30 10:18:37 2007
@@ -38,7 +38,7 @@
         </item>
         <item>
             <key> <string>after_script_name</string> </key>
-            <value> <string>updateBankingOperation</string> </value>
+            <value> <string></string> </value>
         </item>
         <item>
             <key> <string>description</string> </key>

Modified: erp5/trunk/bt5/erp5_banking_cash/WorkflowTemplateItem/portal_workflow/account_incident_workflow/transitions/confirm_action.xml
URL: http://svn.erp5.org/erp5/trunk/bt5/erp5_banking_cash/WorkflowTemplateItem/portal_workflow/account_incident_workflow/transitions/confirm_action.xml?rev=12446&r1=12445&r2=12446&view=diff
==============================================================================
--- erp5/trunk/bt5/erp5_banking_cash/WorkflowTemplateItem/portal_workflow/account_incident_workflow/transitions/confirm_action.xml (original)
+++ erp5/trunk/bt5/erp5_banking_cash/WorkflowTemplateItem/portal_workflow/account_incident_workflow/transitions/confirm_action.xml Tue Jan 30 10:18:37 2007
@@ -60,7 +60,7 @@
         </item>
         <item>
             <key> <string>script_name</string> </key>
-            <value> <string>checkConsistency</string> </value>
+            <value> <string>checkConsistencyAndValidatePositionAccounting</string> </value>
         </item>
         <item>
             <key> <string>title</string> </key>

Modified: erp5/trunk/bt5/erp5_banking_cash/WorkflowTemplateItem/portal_workflow/cash_incident_workflow/transitions/deliver.xml
URL: http://svn.erp5.org/erp5/trunk/bt5/erp5_banking_cash/WorkflowTemplateItem/portal_workflow/cash_incident_workflow/transitions/deliver.xml?rev=12446&r1=12445&r2=12446&view=diff
==============================================================================
--- erp5/trunk/bt5/erp5_banking_cash/WorkflowTemplateItem/portal_workflow/cash_incident_workflow/transitions/deliver.xml (original)
+++ erp5/trunk/bt5/erp5_banking_cash/WorkflowTemplateItem/portal_workflow/cash_incident_workflow/transitions/deliver.xml Tue Jan 30 10:18:37 2007
@@ -32,7 +32,7 @@
         </item>
         <item>
             <key> <string>after_script_name</string> </key>
-            <value> <string></string> </value>
+            <value> <string>updateBankingOperation</string> </value>
         </item>
         <item>
             <key> <string>description</string> </key>

Modified: erp5/trunk/bt5/erp5_banking_cash/WorkflowTemplateItem/portal_workflow/usual_cash_transfer_workflow/scripts/validateVaultBalance.xml
URL: http://svn.erp5.org/erp5/trunk/bt5/erp5_banking_cash/WorkflowTemplateItem/portal_workflow/usual_cash_transfer_workflow/scripts/validateVaultBalance.xml?rev=12446&r1=12445&r2=12446&view=diff
==============================================================================
--- erp5/trunk/bt5/erp5_banking_cash/WorkflowTemplateItem/portal_workflow/usual_cash_transfer_workflow/scripts/validateVaultBalance.xml (original)
+++ erp5/trunk/bt5/erp5_banking_cash/WorkflowTemplateItem/portal_workflow/usual_cash_transfer_workflow/scripts/validateVaultBalance.xml Tue Jan 30 10:18:37 2007
@@ -88,6 +88,11 @@
   msg = Message(domain = "ui", message="Counter is not opened")\n
   raise ValidationFailed, (msg,)\n
 \n
+# use of the constraint : Test source and destination\n
+vliste = transaction.checkConsistency()\n
+transaction.log(\'vliste\', vliste)\n
+if len(vliste) != 0:\n
+  raise ValidationFailed, (vliste[0].getMessage(),)\n
 \n
 resource = transaction.CashDelivery_checkCounterInventory(source=vault, portal_type=\'Cash Delivery Line\')\n
 \n
@@ -166,6 +171,9 @@
                             <string>msg</string>
                             <string>site</string>
                             <string>context</string>
+                            <string>vliste</string>
+                            <string>len</string>
+                            <string>_getitem_</string>
                             <string>resource</string>
                             <string>amount</string>
                             <string>total_price</string>

Modified: erp5/trunk/bt5/erp5_banking_cash/bt/revision
URL: http://svn.erp5.org/erp5/trunk/bt5/erp5_banking_cash/bt/revision?rev=12446&r1=12445&r2=12446&view=diff
==============================================================================
--- erp5/trunk/bt5/erp5_banking_cash/bt/revision (original)
+++ erp5/trunk/bt5/erp5_banking_cash/bt/revision Tue Jan 30 10:18:37 2007
@@ -1,1 +1,1 @@
-144
+146




More information about the Erp5-report mailing list