From 717f0ffd0de186c8777c49c615e57fe43b77ae83 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Bartek=20G=C3=B3rny?= <bartek@gorny.edu.pl>
Date: Thu, 9 Nov 2006 16:09:14 +0000
Subject: [PATCH] fixed a bug which prevented pdf generation from working

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

diff --git a/product/ERP5OOo/OOoTemplate.py b/product/ERP5OOo/OOoTemplate.py
index e61bd46080..2ee76b86e7 100644
--- a/product/ERP5OOo/OOoTemplate.py
+++ b/product/ERP5OOo/OOoTemplate.py
@@ -453,8 +453,9 @@ xmlns:config="http://openoffice.org/2001/config" office:version="1.0">
       ooo = ooo_builder.render(self.title or self.id)
 
       # Convert if necessary
-      format = extra_context.get("format", None)
-      if format is None:
+      opts = extra_context.get("options", None)
+      if opts is not None:
+        format=opts.get("format",None)
         if format == "pdf":
           return self._asPdf(ooo, request)
 
-- 
2.30.9