From 6c1bdd3d59506f75173de08116878629172dd624 Mon Sep 17 00:00:00 2001
From: Rafael Monnerat <rafael@nexedi.com>
Date: Thu, 20 May 2010 17:53:39 +0000
Subject: [PATCH] According to portal_contributions API a file and file_name
 should be provided to create a new document.

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@35503 20353a03-c40f-0410-a6d1-a30d3c3de9de
---
 product/ERP5OOo/Document/OOoDocument.py | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/product/ERP5OOo/Document/OOoDocument.py b/product/ERP5OOo/Document/OOoDocument.py
index 44a4c79623..7ec679ea43 100644
--- a/product/ERP5OOo/Document/OOoDocument.py
+++ b/product/ERP5OOo/Document/OOoDocument.py
@@ -401,6 +401,8 @@ class OOoDocument(PermanentURLMixIn, BaseConvertableAndFileMixin, File,
       else:
         temp_image = self.portal_contributions.newContent(
                                        portal_type='Image',
+                                       file=cStringIO.StringIO(),
+                                       file_name=self.getId(),
                                        temp_object=1)
         temp_image._setData(data)
         mime, data = temp_image.convert(original_format, display=display)
-- 
2.30.9