Commit 380032ac authored by Nicolas Delaby's avatar Nicolas Delaby

Any TempOOoDocument needs to be created with data not base_data.

Calling convertToBaseFormat will fill in base_data with odf content.



git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@35385 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 060093af
...@@ -275,11 +275,11 @@ class FormPrintout(Implicit, Persistent, RoleManager, Item, PropertyManager): ...@@ -275,11 +275,11 @@ class FormPrintout(Implicit, Persistent, RoleManager, Item, PropertyManager):
return printout return printout
from Products.ERP5Type.Document import newTempOOoDocument from Products.ERP5Type.Document import newTempOOoDocument
tmp_ooo = newTempOOoDocument(self, self.title_or_id()) tmp_ooo = newTempOOoDocument(self, self.title_or_id())
tmp_ooo.edit(base_data=printout, tmp_ooo.edit(data=printout,
fname=self.title_or_id(), fname=self.title_or_id(),
source_reference=self.title_or_id(), source_reference=self.title_or_id(),
base_content_type=content_type) content_type=content_type)
tmp_ooo.oo_data = printout tmp_ooo.convertToBaseFormat()
mime, data = tmp_ooo.convert(format) mime, data = tmp_ooo.convert(format)
if REQUEST is not None and not batch_mode: if REQUEST is not None and not batch_mode:
REQUEST.RESPONSE.setHeader('Content-type', mime) REQUEST.RESPONSE.setHeader('Content-type', mime)
......
...@@ -602,11 +602,11 @@ class OOoTemplate(ZopePageTemplate): ...@@ -602,11 +602,11 @@ class OOoTemplate(ZopePageTemplate):
# Now create a temp OOoDocument to convert data to pdf # Now create a temp OOoDocument to convert data to pdf
from Products.ERP5Type.Document import newTempOOoDocument from Products.ERP5Type.Document import newTempOOoDocument
tmp_ooo = newTempOOoDocument(self, self.title_or_id()) tmp_ooo = newTempOOoDocument(self, self.title_or_id())
tmp_ooo.edit(base_data=ooo, tmp_ooo.edit(data=ooo,
fname=self.title_or_id(), fname=self.title_or_id(),
source_reference=self.title_or_id(), source_reference=self.title_or_id(),
base_content_type=self.content_type,) content_type=self.content_type,)
tmp_ooo.oo_data = ooo tmp_ooo.convertToBaseFormat()
if format == 'pdf' and not batch_mode: if format == 'pdf' and not batch_mode:
# Slightly different implementation # Slightly different implementation
# now convert it to pdf # now convert it to pdf
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment