[Erp5-report] r39285 vincent - in /erp5/trunk/bt5/erp5_banking_check: WorkflowTemplateItem/...
nobody at svn.erp5.org
nobody at svn.erp5.org
Mon Oct 18 16:57:10 CEST 2010
Author: vincent
Date: Mon Oct 18 16:57:06 2010
New Revision: 39285
URL: http://svn.erp5.org?rev=39285&view=rev
Log:
Remove conditions on current transition id.
This makes it easier to understand this workflow.
Added:
erp5/trunk/bt5/erp5_banking_check/WorkflowTemplateItem/portal_workflow/check_deposit_workflow/scripts/validatePlanActionConsistency.xml
erp5/trunk/bt5/erp5_banking_check/WorkflowTemplateItem/portal_workflow/check_deposit_workflow/scripts/validateWaitActionConsistency.xml
Modified:
erp5/trunk/bt5/erp5_banking_check/WorkflowTemplateItem/portal_workflow/check_deposit_workflow/scripts/validateConsistency.xml
erp5/trunk/bt5/erp5_banking_check/WorkflowTemplateItem/portal_workflow/check_deposit_workflow/transitions/plan_action.xml
erp5/trunk/bt5/erp5_banking_check/WorkflowTemplateItem/portal_workflow/check_deposit_workflow/transitions/wait_action.xml
erp5/trunk/bt5/erp5_banking_check/bt/revision
Modified: erp5/trunk/bt5/erp5_banking_check/WorkflowTemplateItem/portal_workflow/check_deposit_workflow/scripts/validateConsistency.xml
URL: http://svn.erp5.org/erp5/trunk/bt5/erp5_banking_check/WorkflowTemplateItem/portal_workflow/check_deposit_workflow/scripts/validateConsistency.xml?rev=39285&r1=39284&r2=39285&view=diff
==============================================================================
--- erp5/trunk/bt5/erp5_banking_check/WorkflowTemplateItem/portal_workflow/check_deposit_workflow/scripts/validateConsistency.xml [utf8] (original)
+++ erp5/trunk/bt5/erp5_banking_check/WorkflowTemplateItem/portal_workflow/check_deposit_workflow/scripts/validateConsistency.xml [utf8] Mon Oct 18 16:57:06 2010
@@ -98,12 +98,6 @@ if transaction.getTotalPrice(fast=0, por
msg = Message(domain=\'ui\', message="Total price doesn\'t match.")\n
raise ValidationFailed, (msg,)\n
\n
-# if manual validation, check overdreaft facility\n
-if state_change[\'transition\'].getId() == "wait_action":\n
- context.checkAccountIsOverdraftFacility(state_change)\n
- \n
-\n
-bank_account_dict = {}\n
seen_check_dict = {}\n
\n
is_check_less = transaction.isCheckLess()\n
@@ -161,31 +155,7 @@ for check_operation_line in transaction.
check = transaction.Base_checkCheck(bank_account=source_bank_account, reference=check_number,\n
resource=check_type)\n
if check_operation_line.getAggregate() != check.getRelativeUrl():\n
- check_operation_line.edit(aggregate=check.getRelativeUrl()) \n
- \n
- # Test if the account balance is sufficient.\n
- if state_change[\'transition\'].getId() == "plan_action":\n
- account_path = source_bank_account.getRelativeUrl()\n
- if bank_account_dict.has_key(account_path):\n
- check_price = bank_account_dict[account_path] + check_operation_line.getPrice() \n
- else:\n
- check_price = check_operation_line.getPrice()\n
- bank_account_dict[account_path] = check_price\n
- error = context.BankAccount_checkBalance(account_path, check_price)\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
-if transaction.getSimulationState() == "draft" and state_change[\'transition\'].getId() == "plan_action":\n
- context.createCheckDepositLine(state_change)\n
+ check_operation_line.edit(aggregate=check.getRelativeUrl())\n
]]></string> </value>
@@ -248,8 +218,6 @@ if transaction.getSimulationState() == "
<string>msg</string>
<string>price</string>
<string>destination_bank_account</string>
- <string>context</string>
- <string>bank_account_dict</string>
<string>seen_check_dict</string>
<string>is_check_less</string>
<string>_getiter_</string>
@@ -261,9 +229,6 @@ if transaction.getSimulationState() == "
<string>seen_check</string>
<string>_write_</string>
<string>check</string>
- <string>account_path</string>
- <string>check_price</string>
- <string>error</string>
</tuple>
</value>
</item>
Added: erp5/trunk/bt5/erp5_banking_check/WorkflowTemplateItem/portal_workflow/check_deposit_workflow/scripts/validatePlanActionConsistency.xml
URL: http://svn.erp5.org/erp5/trunk/bt5/erp5_banking_check/WorkflowTemplateItem/portal_workflow/check_deposit_workflow/scripts/validatePlanActionConsistency.xml?rev=39285&view=auto
==============================================================================
--- erp5/trunk/bt5/erp5_banking_check/WorkflowTemplateItem/portal_workflow/check_deposit_workflow/scripts/validatePlanActionConsistency.xml (added)
+++ erp5/trunk/bt5/erp5_banking_check/WorkflowTemplateItem/portal_workflow/check_deposit_workflow/scripts/validatePlanActionConsistency.xml [utf8] Mon Oct 18 16:57:06 2010
@@ -0,0 +1,169 @@
+<?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>Script_magic</string> </key>
+ <value> <int>3</int> </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
+transaction = state_change[\'object\']\n
+\n
+# Test if the account balance is sufficient.\n
+bank_account_dict = {}\n
+for check_operation_line in transaction.objectValues(portal_type=\'Check Operation Line\'):\n
+ account_path = check_operation_line.getSourcePaymentValue().getRelativeUrl()\n
+ bank_account_dict[account_path] = bank_account_dict.get(account_path, 0) + check_operation_line.getPrice()\n
+for account_path, amount in bank_account_dict.items():\n
+ error = context.BankAccount_checkBalance(account_path, amount)[\'error_code\']\n
+ if error == 1:\n
+ raise ValidationFailed, (Message(domain=\'ui\', message="Bank account $account is not sufficient.",\n
+ mapping={"account": source_bank_account.getInternalBankAccountNumber()}), )\n
+ elif error == 2:\n
+ raise ValidationFailed, (Message(domain=\'ui\', message="Bank account $account is not valid.",\n
+ mapping={"account": source_bank_account.getInternalBankAccountNumber()}), )\n
+ elif error != 0:\n
+ raise ValidationFailed, (Message(domain=\'ui\', message="Unknown error code."),)\n
+\n
+context.validateConsistency(state_change)\n
+\n
+if transaction.getSimulationState() == "draft":\n
+ context.createCheckDepositLine(state_change)\n
+</string> </value>
+ </item>
+ <item>
+ <key> <string>_code</string> </key>
+ <value>
+ <none/>
+ </value>
+ </item>
+ <item>
+ <key> <string>_params</string> </key>
+ <value> <string>state_change</string> </value>
+ </item>
+ <item>
+ <key> <string>_proxy_roles</string> </key>
+ <value>
+ <tuple>
+ <string>Manager</string>
+ </tuple>
+ </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>bank_account_dict</string>
+ <string>_getiter_</string>
+ <string>_getattr_</string>
+ <string>check_operation_line</string>
+ <string>account_path</string>
+ <string>_write_</string>
+ <string>amount</string>
+ <string>context</string>
+ <string>error</string>
+ <string>source_bank_account</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>validatePlanActionConsistency</string> </value>
+ </item>
+ <item>
+ <key> <string>warnings</string> </key>
+ <value>
+ <tuple/>
+ </value>
+ </item>
+ </dictionary>
+ </pickle>
+ </record>
+</ZopeData>
Added: erp5/trunk/bt5/erp5_banking_check/WorkflowTemplateItem/portal_workflow/check_deposit_workflow/scripts/validateWaitActionConsistency.xml
URL: http://svn.erp5.org/erp5/trunk/bt5/erp5_banking_check/WorkflowTemplateItem/portal_workflow/check_deposit_workflow/scripts/validateWaitActionConsistency.xml?rev=39285&view=auto
==============================================================================
--- erp5/trunk/bt5/erp5_banking_check/WorkflowTemplateItem/portal_workflow/check_deposit_workflow/scripts/validateWaitActionConsistency.xml (added)
+++ erp5/trunk/bt5/erp5_banking_check/WorkflowTemplateItem/portal_workflow/check_deposit_workflow/scripts/validateWaitActionConsistency.xml [utf8] Mon Oct 18 16:57:06 2010
@@ -0,0 +1,134 @@
+<?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>Script_magic</string> </key>
+ <value> <int>3</int> </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># if manual validation, check overdreaft facility\n
+context.checkAccountIsOverdraftFacility(state_change)\n
+\n
+context.validateConsistency(state_change)\n
+</string> </value>
+ </item>
+ <item>
+ <key> <string>_code</string> </key>
+ <value>
+ <none/>
+ </value>
+ </item>
+ <item>
+ <key> <string>_params</string> </key>
+ <value> <string>state_change</string> </value>
+ </item>
+ <item>
+ <key> <string>_proxy_roles</string> </key>
+ <value>
+ <tuple>
+ <string>Manager</string>
+ </tuple>
+ </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>_getattr_</string>
+ <string>context</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>validateWaitActionConsistency</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/plan_action.xml
URL: http://svn.erp5.org/erp5/trunk/bt5/erp5_banking_check/WorkflowTemplateItem/portal_workflow/check_deposit_workflow/transitions/plan_action.xml?rev=39285&r1=39284&r2=39285&view=diff
==============================================================================
--- erp5/trunk/bt5/erp5_banking_check/WorkflowTemplateItem/portal_workflow/check_deposit_workflow/transitions/plan_action.xml [utf8] (original)
+++ erp5/trunk/bt5/erp5_banking_check/WorkflowTemplateItem/portal_workflow/check_deposit_workflow/transitions/plan_action.xml [utf8] Mon Oct 18 16:57:06 2010
@@ -45,7 +45,7 @@
</item>
<item>
<key> <string>script_name</string> </key>
- <value> <string>validateConsistency</string> </value>
+ <value> <string>validatePlanActionConsistency</string> </value>
</item>
<item>
<key> <string>title</string> </key>
Modified: erp5/trunk/bt5/erp5_banking_check/WorkflowTemplateItem/portal_workflow/check_deposit_workflow/transitions/wait_action.xml
URL: http://svn.erp5.org/erp5/trunk/bt5/erp5_banking_check/WorkflowTemplateItem/portal_workflow/check_deposit_workflow/transitions/wait_action.xml?rev=39285&r1=39284&r2=39285&view=diff
==============================================================================
--- erp5/trunk/bt5/erp5_banking_check/WorkflowTemplateItem/portal_workflow/check_deposit_workflow/transitions/wait_action.xml [utf8] (original)
+++ erp5/trunk/bt5/erp5_banking_check/WorkflowTemplateItem/portal_workflow/check_deposit_workflow/transitions/wait_action.xml [utf8] Mon Oct 18 16:57:06 2010
@@ -45,7 +45,7 @@
</item>
<item>
<key> <string>script_name</string> </key>
- <value> <string>validateConsistency</string> </value>
+ <value> <string>validateWaitActionConsistency</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=39285&r1=39284&r2=39285&view=diff
==============================================================================
--- erp5/trunk/bt5/erp5_banking_check/bt/revision [utf8] (original)
+++ erp5/trunk/bt5/erp5_banking_check/bt/revision [utf8] Mon Oct 18 16:57:06 2010
@@ -1 +1 @@
-447
\ No newline at end of file
+465
More information about the Erp5-report
mailing list