From 882cf9f8e986a6e1cebe69822a9085972da388e0 Mon Sep 17 00:00:00 2001
From: Vincent Pelletier <vincent@nexedi.com>
Date: Tue, 8 Sep 2009 11:28:03 +0000
Subject: [PATCH] Make validateVaultBalance call [...]_checkPath script, just
 as it is done in cash_movement_workflow.

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@28866 20353a03-c40f-0410-a6d1-a30d3c3de9de
---
 .../scripts/validateVaultBalance.xml                 | 12 ++++++++++++
 bt5/erp5_banking_cash/bt/revision                    |  2 +-
 2 files changed, 13 insertions(+), 1 deletion(-)

diff --git a/bt5/erp5_banking_cash/WorkflowTemplateItem/portal_workflow/cash_movement_new_not_emitted_workflow/scripts/validateVaultBalance.xml b/bt5/erp5_banking_cash/WorkflowTemplateItem/portal_workflow/cash_movement_new_not_emitted_workflow/scripts/validateVaultBalance.xml
index d4ed748191..f6b4bbcda6 100644
--- a/bt5/erp5_banking_cash/WorkflowTemplateItem/portal_workflow/cash_movement_new_not_emitted_workflow/scripts/validateVaultBalance.xml
+++ b/bt5/erp5_banking_cash/WorkflowTemplateItem/portal_workflow/cash_movement_new_not_emitted_workflow/scripts/validateVaultBalance.xml
@@ -85,6 +85,13 @@ transaction.log(\'vliste\', vliste)\n
 if len(vliste) != 0:\n
   raise ValidationFailed, (vliste[0].getMessage(),)\n
 \n
+portal_type_with_no_space = transaction.getPortalType().replace(\' \',\'\')\n
+check_path_script = getattr(transaction,\'%s_checkPath\' % portal_type_with_no_space,None)\n
+if check_path_script is not None:\n
+  message = check_path_script()\n
+  if message is not None:\n
+    raise ValidationFailed, (message,)\n
+\n
 resource = transaction.CashDelivery_checkCounterInventory(source=vault, portal_type=\'Cash Movement New Not Emitted Line\')\n
 \n
 \n
@@ -157,6 +164,11 @@ elif resource <> 0 :\n
                             <string>vaultDestination</string>
                             <string>vliste</string>
                             <string>len</string>
+                            <string>portal_type_with_no_space</string>
+                            <string>getattr</string>
+                            <string>None</string>
+                            <string>check_path_script</string>
+                            <string>message</string>
                             <string>resource</string>
                             <string>amount</string>
                             <string>total_price</string>
diff --git a/bt5/erp5_banking_cash/bt/revision b/bt5/erp5_banking_cash/bt/revision
index c029c62fca..8e6ba7fb6c 100644
--- a/bt5/erp5_banking_cash/bt/revision
+++ b/bt5/erp5_banking_cash/bt/revision
@@ -1 +1 @@
-672
\ No newline at end of file
+675
\ No newline at end of file
-- 
2.30.9