From 566dc9cbbae153d117e9c0881f57f653698ddf2d Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?J=C3=A9rome=20Perrin?= <jerome@nexedi.com>
Date: Wed, 3 Apr 2013 10:57:48 +0200
Subject: [PATCH] Use a better message

---
 .../testFolderWorkflowActionNothingSelected.xml        |  2 +-
 bt5/erp5_ui_test/bt/revision                           |  2 +-
 .../Base_validateFolderWorkflowActionDialog.xml        | 10 +++++++---
 product/ERP5/bootstrap/erp5_core/bt/revision           |  2 +-
 4 files changed, 10 insertions(+), 6 deletions(-)

diff --git a/bt5/erp5_ui_test/PathTemplateItem/portal_tests/page_templates_zuite/testFolderWorkflowActionNothingSelected.xml b/bt5/erp5_ui_test/PathTemplateItem/portal_tests/page_templates_zuite/testFolderWorkflowActionNothingSelected.xml
index f9fcceb61c..9d09f05045 100644
--- a/bt5/erp5_ui_test/PathTemplateItem/portal_tests/page_templates_zuite/testFolderWorkflowActionNothingSelected.xml
+++ b/bt5/erp5_ui_test/PathTemplateItem/portal_tests/page_templates_zuite/testFolderWorkflowActionNothingSelected.xml
@@ -131,7 +131,7 @@
 </tr>\n
 <tr>\n
   <td>assertPortalStatusMessage</td>\n
-  <td>You must select one action.</td>\n
+  <td>You must select only one action.</td>\n
   <td></td>\n
 </tr>\n
 \n
diff --git a/bt5/erp5_ui_test/bt/revision b/bt5/erp5_ui_test/bt/revision
index 2764f7b002..c5321a6e72 100644
--- a/bt5/erp5_ui_test/bt/revision
+++ b/bt5/erp5_ui_test/bt/revision
@@ -1 +1 @@
-708
\ No newline at end of file
+709
\ No newline at end of file
diff --git a/product/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/Base_validateFolderWorkflowActionDialog.xml b/product/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/Base_validateFolderWorkflowActionDialog.xml
index 0850489873..2390641e6d 100644
--- a/product/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/Base_validateFolderWorkflowActionDialog.xml
+++ b/product/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/Base_validateFolderWorkflowActionDialog.xml
@@ -50,12 +50,16 @@
         </item>
         <item>
             <key> <string>_body</string> </key>
-            <value> <string>if len([choice for choice in editor.values() if choice[\'workflow_action\']]) == 1:\n
+            <value> <string>from Products.ERP5Type.Message import translateString\n
+choosen = [choice for choice in editor.values() if choice[\'workflow_action\']]\n
+if len(choosen) == 1:\n
   return True\n
 \n
-from Products.ERP5Type.Message import translateString\n
 # XXX listbox validator does not show the validation failed message, so use portal status message instead\n
-container.REQUEST.set(\'portal_status_message\', translateString("You must select one action."))\n
+if len(choosen) == 0:\n
+  container.REQUEST.set(\'portal_status_message\', translateString("You must select one action."))\n
+else:
+  container.REQUEST.set(\'portal_status_message\', translateString("You must select only one action."))\n
 return False\n
 </string> </value>
         </item>
diff --git a/product/ERP5/bootstrap/erp5_core/bt/revision b/product/ERP5/bootstrap/erp5_core/bt/revision
index 502476f9b9..c049865262 100644
--- a/product/ERP5/bootstrap/erp5_core/bt/revision
+++ b/product/ERP5/bootstrap/erp5_core/bt/revision
@@ -1 +1 @@
-41076
\ No newline at end of file
+41077
-- 
2.30.9