From 7ff1bdabc1fc49e85d5c5d60c8522f3cceb36459 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Aur=C3=A9lien=20Calonne?= <aurel@nexedi.com>
Date: Wed, 29 Aug 2007 10:04:59 +0000
Subject: [PATCH] forms and workflow fix for monetary survey

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@15898 20353a03-c40f-0410-a6d1-a30d3c3de9de
---
 .../MonetarySurvey_view/my_total_price.xml    | 29 ++++++++++++++-----
 .../scripts/validateVaultBalance.xml          |  5 ++++
 bt5/erp5_banking_cash/bt/revision             |  2 +-
 3 files changed, 28 insertions(+), 8 deletions(-)

diff --git a/bt5/erp5_banking_cash/SkinTemplateItem/portal_skins/erp5_banking_cash/MonetarySurvey_view/my_total_price.xml b/bt5/erp5_banking_cash/SkinTemplateItem/portal_skins/erp5_banking_cash/MonetarySurvey_view/my_total_price.xml
index 92f415ce9d..619dd832bc 100644
--- a/bt5/erp5_banking_cash/SkinTemplateItem/portal_skins/erp5_banking_cash/MonetarySurvey_view/my_total_price.xml
+++ b/bt5/erp5_banking_cash/SkinTemplateItem/portal_skins/erp5_banking_cash/MonetarySurvey_view/my_total_price.xml
@@ -123,7 +123,9 @@
                 </item>
                 <item>
                     <key> <string>default</string> </key>
-                    <value> <string></string> </value>
+                    <value>
+                      <persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
+                    </value>
                 </item>
                 <item>
                     <key> <string>description</string> </key>
@@ -160,7 +162,7 @@
                 <item>
                     <key> <string>input_style</string> </key>
                     <value>
-                      <persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
+                      <persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent>
                     </value>
                 </item>
                 <item>
@@ -259,11 +261,24 @@
   <record id="2" aka="AAAAAAAAAAI=">
     <pickle>
       <tuple>
-        <tuple>
-          <string>Products.Formulator.TALESField</string>
-          <string>TALESMethod</string>
-        </tuple>
-        <none/>
+        <global name="TALESMethod" module="Products.Formulator.TALESField"/>
+        <tuple/>
+      </tuple>
+    </pickle>
+    <pickle>
+      <dictionary>
+        <item>
+            <key> <string>_text</string> </key>
+            <value> <string>python: here.getTotalPrice(fast=0)</string> </value>
+        </item>
+      </dictionary>
+    </pickle>
+  </record>
+  <record id="3" aka="AAAAAAAAAAM=">
+    <pickle>
+      <tuple>
+        <global name="TALESMethod" module="Products.Formulator.TALESField"/>
+        <tuple/>
       </tuple>
     </pickle>
     <pickle>
diff --git a/bt5/erp5_banking_cash/WorkflowTemplateItem/portal_workflow/monetary_survey_workflow/scripts/validateVaultBalance.xml b/bt5/erp5_banking_cash/WorkflowTemplateItem/portal_workflow/monetary_survey_workflow/scripts/validateVaultBalance.xml
index e52cbb8b43..8435295532 100644
--- a/bt5/erp5_banking_cash/WorkflowTemplateItem/portal_workflow/monetary_survey_workflow/scripts/validateVaultBalance.xml
+++ b/bt5/erp5_banking_cash/WorkflowTemplateItem/portal_workflow/monetary_survey_workflow/scripts/validateVaultBalance.xml
@@ -75,6 +75,10 @@ date = transaction.getStartDate()\n
 vault = transaction.getSource()\n
 destination = transaction.getDestination()\n
 \n
+if vault is None or destination is None:\n
+   msg = Message(domain="ui", message="You must define source and destination.")\n
+   raise ValidationFailed, (msg,)\n
+   \n
 \n
 # check we are in an opened accounting day\n
 transaction.Baobab_checkCounterDateOpen(site=vault, date=date)\n
@@ -170,6 +174,7 @@ elif resource <> 0 :\n
                             <string>date</string>
                             <string>vault</string>
                             <string>destination</string>
+                            <string>None</string>
                             <string>msg</string>
                             <string>resource</string>
                             <string>amount</string>
diff --git a/bt5/erp5_banking_cash/bt/revision b/bt5/erp5_banking_cash/bt/revision
index 4f09af7132..266217da54 100644
--- a/bt5/erp5_banking_cash/bt/revision
+++ b/bt5/erp5_banking_cash/bt/revision
@@ -1 +1 @@
-492
\ No newline at end of file
+493
\ No newline at end of file
-- 
2.30.9