From daebbadf5773faa59ae76fb9d18cab072a69f5ee Mon Sep 17 00:00:00 2001
From: Vincent Pelletier <vincent@nexedi.com>
Date: Mon, 24 Dec 2007 16:32:39 +0000
Subject: [PATCH] Display all errors at once when importing a list checkbooks,
 to relieve the user from the hassle to reimport after fixing each error.

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@18499 20353a03-c40f-0410-a6d1-a30d3c3de9de
---
 .../ExtensionTemplateItem/CheckbookReceptionImport.py          | 3 ++-
 bt5/erp5_banking_check/bt/revision                             | 2 +-
 2 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/bt5/erp5_banking_check/ExtensionTemplateItem/CheckbookReceptionImport.py b/bt5/erp5_banking_check/ExtensionTemplateItem/CheckbookReceptionImport.py
index 5e753b4e8e..da42c1ce30 100644
--- a/bt5/erp5_banking_check/ExtensionTemplateItem/CheckbookReceptionImport.py
+++ b/bt5/erp5_banking_check/ExtensionTemplateItem/CheckbookReceptionImport.py
@@ -68,6 +68,7 @@ def CheckbookReception_importItemFile(self, import_file=None, REQUEST=None, **kw
         if is_checkbook:
           listbox_line['check_amount'] = resource_amount_dict[item_dict['check_quantity']]
         listbox.append(listbox_line)
+        i += 1
     listbox_dict[resource_relative_url] = listbox
   # First make sure there is no errors
   message = None
@@ -81,7 +82,7 @@ def CheckbookReception_importItemFile(self, import_file=None, REQUEST=None, **kw
                                        resource=resource_relative_url,
                                        REQUEST=REQUEST)
     if error_value:
-      message = field_error_dict.values()[0].error_text
+      message = ', '.join([str(x.error_text) for x in field_error_dict.itervalues()])
       redirect_url = '%s/view?%s' % ( self.absolute_url()
                                 , 'portal_status_message=%s' % message)
       REQUEST['RESPONSE'].redirect( redirect_url )
diff --git a/bt5/erp5_banking_check/bt/revision b/bt5/erp5_banking_check/bt/revision
index ac471d3ba0..2a9c18ad50 100644
--- a/bt5/erp5_banking_check/bt/revision
+++ b/bt5/erp5_banking_check/bt/revision
@@ -1 +1 @@
-355
\ No newline at end of file
+357
\ No newline at end of file
-- 
2.30.9