Commit 746d82fd authored by Yoshinori Okuji's avatar Yoshinori Okuji

ERP5 Type Information must be treated specially, even if save is false.

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@18178 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent e32a0a9e
...@@ -105,12 +105,20 @@ class TrashTool(BaseTool): ...@@ -105,12 +105,20 @@ class TrashTool(BaseTool):
# so object is not backup # so object is not backup
LOG("Trash Tool backupObject", 100, "Can't backup object %s" %(object_id)) LOG("Trash Tool backupObject", 100, "Can't backup object %s" %(object_id))
pass pass
# in case of portal types, export properties instead of subobjects
if obj is None: keep_sub = kw.get('keep_subobjects', 0)
subobjects_dict = {}
if not keep_sub:
# export subobjects
if save:
obj = backup_object_container._getOb(object_id)
else:
object_path = container_path + [object_id] object_path = container_path + [object_id]
obj = self.unrestrictedTraverse(object_path, None) obj = self.unrestrictedTraverse(object_path)
if obj is None: if obj is None:
pass pass
# in case of portal types, export properties instead of subobjects
elif getattr(obj, 'meta_type', None) == 'ERP5 Type Information': elif getattr(obj, 'meta_type', None) == 'ERP5 Type Information':
subobjects_dict = {} subobjects_dict = {}
subobjects_dict['allowed_content_type_list'] = getattr(obj, 'allowed_content_types', []) or [] subobjects_dict['allowed_content_type_list'] = getattr(obj, 'allowed_content_types', []) or []
...@@ -127,20 +135,6 @@ class TrashTool(BaseTool): ...@@ -127,20 +135,6 @@ class TrashTool(BaseTool):
subobjects_dict['workflow_chain'] = wf_chain['chain_%s' % object_id] subobjects_dict['workflow_chain'] = wf_chain['chain_%s' % object_id]
else: else:
subobjects_dict['workflow_chain'] = '' subobjects_dict['workflow_chain'] = ''
return subobjects_dict
keep_sub = kw.get('keep_subobjects', 0)
subobjects_dict = {}
if not keep_sub:
# export subobjects
if save:
obj = backup_object_container._getOb(object_id)
else:
object_path = container_path + [object_id]
obj = self.unrestrictedTraverse(object_path)
if obj is None:
pass
else: else:
for subobject_id in list(obj.objectIds()): for subobject_id in list(obj.objectIds()):
subobject_path = object_path + [subobject_id] subobject_path = object_path + [subobject_id]
......
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