fixed bug 29313: attachment download of different records at once fails
authorAsier Lostalé <asier.lostale@openbravo.com>
Wed, 18 Mar 2015 09:08:59 +0100
changeset 26200 7b67971d79d2
parent 26199 be3f7a8bed0a
child 26201 bb2fdcffc429
fixed bug 29313: attachment download of different records at once fails

It generated an invalid zip file.

The problem was it tried to find the attachment directory based on the whole
list of ids to download instead of splitting it.
src/org/openbravo/erpCommon/businessUtility/TabAttachments.java
--- a/src/org/openbravo/erpCommon/businessUtility/TabAttachments.java	Tue Mar 17 23:03:03 2015 +0000
+++ b/src/org/openbravo/erpCommon/businessUtility/TabAttachments.java	Wed Mar 18 09:08:59 2015 +0100
@@ -293,8 +293,8 @@
       attachmentFiles.list().toArray();
       HashMap<String, Integer> writtenFiles = new HashMap<String, Integer>();
       for (Attachment attachmentFile : attachmentFiles.list()) {
-        String attachmentDirectory = TabAttachments.getAttachmentDirectory(tableId, recordIds,
-            attachmentFile.getName());
+        String attachmentDirectory = TabAttachments.getAttachmentDirectory(tableId,
+            attachmentFile.getRecord(), attachmentFile.getName());
         final File file = new File(globalParameters.strFTPDirectory + "/" + attachmentDirectory,
             attachmentFile.getName());
         String zipName = "";