diff --git a/product/ERP5/Document/Document.py b/product/ERP5/Document/Document.py index 3a6bb9d0d97cbcbdc27da4e1f5e0f104108c9dac..4c33b36bc2813879222c4da8c31c6285c4bc092e 100644 --- a/product/ERP5/Document/Document.py +++ b/product/ERP5/Document/Document.py @@ -362,12 +362,18 @@ class PermanentURLMixIn(ExtensibleTraversableMixIn): except KeyError: pass - if method is None: method = self._getTypeBasedMethod('getDocumentValue', - fallback_script_id='WebSection_getDocumentValue') + if method is None: + method = self._getTypeBasedMethod('getDocumentValue', + fallback_script_id='WebSection_getDocumentValue') if cache is not None: - if cache.get(key, _MARKER) is _MARKER: cache[key] = method - return method(name, portal=portal, **kw) + if cache.get(key, _MARKER) is _MARKER: + cache[key] = method + + document = method(name, portal=portal, **kw) + if document is not None: + document = document.__of__(self) + return document class Document(PermanentURLMixIn, XMLObject, UrlMixIn, ConversionCacheMixin, SnapshotMixin): """ diff --git a/product/ERP5/Document/WebSection.py b/product/ERP5/Document/WebSection.py index a6d8a1963e87e9266a3e5f6c8e79ab81191255e0..5ed605bc0b5e37b6245b70577dc292d67ced452a 100644 --- a/product/ERP5/Document/WebSection.py +++ b/product/ERP5/Document/WebSection.py @@ -222,6 +222,8 @@ class WebSection(Domain, PermanentURLMixIn): result = self._getTypeBasedMethod('getDefaultDocumentValue', fallback_script_id='WebSection_getDefaultDocumentValue')() + if result is not None: + result = result.__of__(self) if cache is not None: cache[key] = result @@ -251,6 +253,8 @@ class WebSection(Domain, PermanentURLMixIn): result = self._getTypeBasedMethod('getDocumentValueList', fallback_script_id='WebSection_getDocumentValueList')(**kw) + if result is not None: + result = [doc.__of__(self) for doc in result] if cache is not None: cache[key] = result