[Erp5-report] r19040 - in /erp5/trunk/bt5/erp5_banking_check: WorkflowTemplateItem/portal_w...
nobody at svn.erp5.org
nobody at svn.erp5.org
Tue Feb 5 11:22:24 CET 2008
Author: aurel
Date: Tue Feb 5 11:22:23 2008
New Revision: 19040
URL: http://svn.erp5.org?rev=19040&view=rev
Log:
check balance before delivery
Added:
erp5/trunk/bt5/erp5_banking_check/WorkflowTemplateItem/portal_workflow/check_deposit_workflow/scripts/checkCheckBeforeDelivery.xml
Modified:
erp5/trunk/bt5/erp5_banking_check/WorkflowTemplateItem/portal_workflow/check_deposit_workflow/transitions/deliver_action.xml
erp5/trunk/bt5/erp5_banking_check/bt/revision
Added: erp5/trunk/bt5/erp5_banking_check/WorkflowTemplateItem/portal_workflow/check_deposit_workflow/scripts/checkCheckBeforeDelivery.xml
URL: http://svn.erp5.org/erp5/trunk/bt5/erp5_banking_check/WorkflowTemplateItem/portal_workflow/check_deposit_workflow/scripts/checkCheckBeforeDelivery.xml?rev=19040&view=auto
==============================================================================
--- erp5/trunk/bt5/erp5_banking_check/WorkflowTemplateItem/portal_workflow/check_deposit_workflow/scripts/checkCheckBeforeDelivery.xml (added)
+++ erp5/trunk/bt5/erp5_banking_check/WorkflowTemplateItem/portal_workflow/check_deposit_workflow/scripts/checkCheckBeforeDelivery.xml Tue Feb 5 11:22:23 2008
@@ -1,0 +1,197 @@
+<?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>from Products.DCWorkflow.DCWorkflow import ValidationFailed\n
+from Products.ERP5Type.Message import Message\n
+\n
+obj = state_change[\'object\']\n
+context.checkUserPermission(state_change)\n
+wf_h = obj.Base_getWorkflowHistory()\n
+wf_h = wf_h[\'account_transfer_workflow\'][\'item_list\']\n
+\n
+manual_validation = 0\n
+waiting_state = wf_h[3]\n
+if waiting_state == "waiting":\n
+ manual_validation = 1\n
+\n
+context.log("waiting state", waiting_state)\n
+\n
+if manual_validation:\n
+ return\n
+else:\n
+ # check balance for each line\n
+ for check_operation_line in obj.contentValues(filter = {\'portal_type\' : \'Check Operation Line\'}):\n
+ source_bank_account = check_operation_line.getSourcePaymentValue()\n
+ # Test if the account balance is sufficient.\n
+ error = context.BankAccount_checkBalance(source_bank_account.getRelativeUrl(), check_operation_line.getPrice())\n
+ if error[\'error_code\'] == 1:\n
+ msg = Message(domain=\'ui\', message="Bank account $account is not sufficient on line $line.",\n
+ mapping={"account": source_bank_account.getInternalBankAccountNumber(), "line" : check_operation_line.getId()})\n
+ raise ValidationFailed, (msg,)\n
+ elif error[\'error_code\'] == 2:\n
+ msg = Message(domain=\'ui\', message="Bank account $account is not valid on $line.",\n
+ mapping={"account": source_bank_account.getInternalBankAccountNumber(), "line" : check_operation_line.getId()})\n
+ raise ValidationFailed, (msg,)\n
+ elif error[\'error_code\'] != 0:\n
+ msg = Message(domain=\'ui\', message="Unknown error code.")\n
+ raise ValidationFailed, (msg,)\n
+\n
+\n
+context.validateSourceAndDestination(state_change)\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>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>obj</string>
+ <string>_getattr_</string>
+ <string>context</string>
+ <string>wf_h</string>
+ <string>manual_validation</string>
+ <string>waiting_state</string>
+ <string>_getiter_</string>
+ <string>check_operation_line</string>
+ <string>source_bank_account</string>
+ <string>error</string>
+ <string>msg</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>checkCheckBeforeDelivery</string> </value>
+ </item>
+ <item>
+ <key> <string>warnings</string> </key>
+ <value>
+ <tuple/>
+ </value>
+ </item>
+ </dictionary>
+ </pickle>
+ </record>
+</ZopeData>
Modified: erp5/trunk/bt5/erp5_banking_check/WorkflowTemplateItem/portal_workflow/check_deposit_workflow/transitions/deliver_action.xml
URL: http://svn.erp5.org/erp5/trunk/bt5/erp5_banking_check/WorkflowTemplateItem/portal_workflow/check_deposit_workflow/transitions/deliver_action.xml?rev=19040&r1=19039&r2=19040&view=diff
==============================================================================
--- erp5/trunk/bt5/erp5_banking_check/WorkflowTemplateItem/portal_workflow/check_deposit_workflow/transitions/deliver_action.xml (original)
+++ erp5/trunk/bt5/erp5_banking_check/WorkflowTemplateItem/portal_workflow/check_deposit_workflow/transitions/deliver_action.xml Tue Feb 5 11:22:23 2008
@@ -57,7 +57,7 @@
</item>
<item>
<key> <string>script_name</string> </key>
- <value> <string>validateSourceAndDestination</string> </value>
+ <value> <string>checkCheckBeforeDelivery</string> </value>
</item>
<item>
<key> <string>title</string> </key>
Modified: erp5/trunk/bt5/erp5_banking_check/bt/revision
URL: http://svn.erp5.org/erp5/trunk/bt5/erp5_banking_check/bt/revision?rev=19040&r1=19039&r2=19040&view=diff
==============================================================================
--- erp5/trunk/bt5/erp5_banking_check/bt/revision (original)
+++ erp5/trunk/bt5/erp5_banking_check/bt/revision Tue Feb 5 11:22:23 2008
@@ -1,1 +1,1 @@
-371
+374
More information about the Erp5-report
mailing list