From 8ba092ec0f1739a40ef5284f24c6b14b14e380a8 Mon Sep 17 00:00:00 2001
From: Alexandre Boeglin <alex@nexedi.com>
Date: Fri, 9 Nov 2007 17:33:24 +0000
Subject: [PATCH] should not cache persistant objects

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@17502 20353a03-c40f-0410-a6d1-a30d3c3de9de
---
 product/ERP5Type/Base.py | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/product/ERP5Type/Base.py b/product/ERP5Type/Base.py
index 1055fa34a4..44b5b50c04 100644
--- a/product/ERP5Type/Base.py
+++ b/product/ERP5Type/Base.py
@@ -2699,9 +2699,10 @@ class Base( CopyContainer,
         name = ''.join([script_name_begin.replace(' ',''), script_name_end])
         script = getattr(self, name, None)
         if script is not None:
-          return script
+          return name
     cached_getattr = CachingMethod(cached_getattr, id='Base__getattr',
         cache_factory='erp5_content_long')
+
     # script_id should not be used any more, keep compatibility
     if script_id is not None:
       LOG('ERP5Type/Base.getTypeBaseMethod',0,
@@ -2709,9 +2710,9 @@ class Base( CopyContainer,
       fallback_script_id=script_id
     # Look at a local script which
     # can return a new predicate.
-    script = cached_getattr(self.getPortalType(), method_id)
-    if script is not None:
-      return script.__of__(self)
+    name = cached_getattr(self.getPortalType(), method_id)
+    if name is not None:
+      return getattr(self, name)
     if fallback_script_id is not None:
       return getattr(self, fallback_script_id)
 
-- 
2.30.9