From 70a2d2ff46dfe70da1a018def14e82c0bd5acdcd Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?J=C3=A9rome=20Perrin?= <jerome@nexedi.com>
Date: Mon, 8 Aug 2005 10:14:23 +0000
Subject: [PATCH] put a correct 'here' in TALES context

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@3556 20353a03-c40f-0410-a6d1-a30d3c3de9de
---
 product/ERP5Form/PDFForm.py | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/product/ERP5Form/PDFForm.py b/product/ERP5Form/PDFForm.py
index 40bf87451d..ae43809fe3 100755
--- a/product/ERP5Form/PDFForm.py
+++ b/product/ERP5Form/PDFForm.py
@@ -44,7 +44,6 @@ from tempfile import mktemp
 
 try:
     from webdav.Lockable import ResourceLockedError
-    from webdav.WriteLockInterface import WriteLockInterface
     SUPPORTS_WEBDAV_LOCKS = 1
 except ImportError:
     SUPPORTS_WEBDAV_LOCKS = 0
@@ -347,8 +346,7 @@ class PDFForm(File):
     def generatePDF(self, REQUEST=None, RESPONSE=None, *args, **kwargs) :
         """ generates the PDF with form filled in """
         values = self.calculateCellValues(REQUEST, *args, **kwargs)
-
-        context = {'here' : self, 'request' : REQUEST}
+        context = {'here' : self.aq_parent, 'request' : REQUEST}
         if hasattr(self, "__format_method__") and self.__format_method__ not in ('', None) :
             compiled_tales = getEngine().compile(self.__format_method__)
             format_method = getEngine().getContext(context).evaluate(compiled_tales)
@@ -444,7 +442,7 @@ class PDFForm(File):
         # (and this also raises the KeyError for non existant cells)
         if not self.cells[cell_name] :
             return None
-        context = {'here' : self, 'request' : REQUEST}
+        context = {'here' : self.aq_parent, 'request' : REQUEST}
         context.update (kwargs)
 
         compiled_tales = getEngine().compile(self.cells[cell_name])
-- 
2.30.9