[Erp5-report] r18178 - /erp5/trunk/products/ERP5/Tool/TrashTool.py
nobody at svn.erp5.org
nobody at svn.erp5.org
Mon Dec 10 14:46:19 CET 2007
Author: yo
Date: Mon Dec 10 14:46:18 2007
New Revision: 18178
URL: http://svn.erp5.org?rev=18178&view=rev
Log:
ERP5 Type Information must be treated specially, even if save is false.
Modified:
erp5/trunk/products/ERP5/Tool/TrashTool.py
Modified: erp5/trunk/products/ERP5/Tool/TrashTool.py
URL: http://svn.erp5.org/erp5/trunk/products/ERP5/Tool/TrashTool.py?rev=18178&r1=18177&r2=18178&view=diff
==============================================================================
--- erp5/trunk/products/ERP5/Tool/TrashTool.py (original)
+++ erp5/trunk/products/ERP5/Tool/TrashTool.py Mon Dec 10 14:46:18 2007
@@ -105,12 +105,20 @@
# so object is not backup
LOG("Trash Tool backupObject", 100, "Can't backup object %s" %(object_id))
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]
- obj = self.unrestrictedTraverse(object_path, None)
+ obj = self.unrestrictedTraverse(object_path)
if obj is None:
pass
+ # in case of portal types, export properties instead of subobjects
elif getattr(obj, 'meta_type', None) == 'ERP5 Type Information':
subobjects_dict = {}
subobjects_dict['allowed_content_type_list'] = getattr(obj, 'allowed_content_types', []) or []
@@ -127,20 +135,6 @@
subobjects_dict['workflow_chain'] = wf_chain['chain_%s' % object_id]
else:
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:
for subobject_id in list(obj.objectIds()):
subobject_path = object_path + [subobject_id]
More information about the Erp5-report
mailing list