diff --git a/product/ERP5Type/Base.py b/product/ERP5Type/Base.py index ae1b9f6429c8cc234c4395a495a34ed7c7800fd3..1a9e1f03415306cd61de7f61a19ec23718b742d4 100644 --- a/product/ERP5Type/Base.py +++ b/product/ERP5Type/Base.py @@ -2713,12 +2713,31 @@ class Base( CopyContainer, self.activate(group_method_id='portal_catalog/catalogObjectList', alternate_method_id='alternateReindexObject', group_id=group_id, - serialization_tag=self.getPath() + '%', + serialization_tag=self.getRootDocument(), **activate_kw).immediateReindexObject(**kw) security.declarePublic('recursiveReindexObject') recursiveReindexObject = reindexObject + def getRootDocument(self): + result = self.getRootDocumentValue() + if result is not None: + result = result.getPath() + return result + + def getRootDocumentValue(self): + result = None + parent_value = self.getParentValue() + if parent_value is not None: + parent_id = parent_value.getId() + if parent_id.endswith('_module') or parent_id.startswith('portal_'): + result = self + else: + getRootDocumentValue = getattr(parent_value, 'getRootDocumentValue', None) + if getRootDocumentValue is not None: + result = getRootDocumentValue() + return result + security.declareProtected( Permissions.AccessContentsInformation, 'getIndexableChildValueList' ) def getIndexableChildValueList(self): """ diff --git a/product/ERP5Type/Core/Folder.py b/product/ERP5Type/Core/Folder.py index 70d37edae7fba11e7c97ae9ec9b4a67b32b886b8..d0a0c19375e6ab603671e5f125c46ea09690f2ab 100644 --- a/product/ERP5Type/Core/Folder.py +++ b/product/ERP5Type/Core/Folder.py @@ -1101,7 +1101,7 @@ class Folder(CopyContainer, CMFBTreeFolder, CMFHBTreeFolder, Base, FolderMixIn, expand_method_id='getIndexableChildValueList', alternate_method_id='alternateReindexObject', group_id=group_id, - serialization_tag=self.getPath() + '%', + serialization_tag=self.getRootDocument(), **activate_kw).recursiveImmediateReindexObject(**kw) security.declareProtected( Permissions.AccessContentsInformation,