Commit ccb82aae authored by Aurel's avatar Aurel

propagate default activate_kw from parent to child objects


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@16265 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 3b4e308d
...@@ -121,7 +121,7 @@ class CopyContainer: ...@@ -121,7 +121,7 @@ class CopyContainer:
if changed != 0: if changed != 0:
object.setCategoryList(category_list) object.setCategoryList(category_list)
def _recursiveSetActivityAfterTag(self, obj): def _recursiveSetActivityAfterTag(self, obj, activate_kw=None):
""" """
Make sure to set an after tag on each object Make sure to set an after tag on each object
so that it is possible to unindex before doing so that it is possible to unindex before doing
...@@ -129,14 +129,15 @@ class CopyContainer: ...@@ -129,14 +129,15 @@ class CopyContainer:
""" """
uid = getattr(aq_base(obj), 'uid', None) uid = getattr(aq_base(obj), 'uid', None)
if uid is not None: if uid is not None:
activate_kw = obj.getDefaultActivateParameterDict() if activate_kw is None:
activate_kw = obj.getDefaultActivateParameterDict()
try: try:
activate_kw["after_tag"] = str(uid) activate_kw["after_tag"] = str(uid)
except TypeError: except TypeError:
activate_kw = {"after_tag":str(uid),} activate_kw = {"after_tag":str(uid),}
obj.setDefaultActivateParameters(**activate_kw) obj.setDefaultActivateParameters(**activate_kw)
for sub_obj in obj.objectValues(): for sub_obj in obj.objectValues():
self._recursiveSetActivityAfterTag(sub_obj) self._recursiveSetActivityAfterTag(sub_obj, activate_kw)
security.declareProtected( Permissions.ModifyPortalContent, 'manage_renameObject' ) security.declareProtected( Permissions.ModifyPortalContent, 'manage_renameObject' )
def manage_renameObject(self, id=None, new_id=None, REQUEST=None): def manage_renameObject(self, id=None, new_id=None, REQUEST=None):
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment