[Erp5-report] r26620 - /erp5/trunk/products/ERP5/Tool/TrashTool.py
nobody at svn.erp5.org
nobody at svn.erp5.org
Fri Apr 24 16:36:18 CEST 2009
Author: aurel
Date: Fri Apr 24 16:36:18 2009
New Revision: 26620
URL: http://svn.erp5.org?rev=26620&view=rev
Log:
check that newContent exists on current container otherwise use zope
method to create folder
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=26620&r1=26619&r2=26620&view=diff
==============================================================================
--- erp5/trunk/products/ERP5/Tool/TrashTool.py [utf8] (original)
+++ erp5/trunk/products/ERP5/Tool/TrashTool.py [utf8] Fri Apr 24 16:36:18 2009
@@ -65,9 +65,13 @@
if 'portal' in path:
path += '_items'
if path not in backup_object_container.objectIds():
- backup_object_container = backup_object_container.newContent(portal_type='Trash Folder', id=path,
- is_indexable=0)
- backup_object_container.edit(isHidden=1)
+ if not hasattr(aq_base(backup_object_container), "newContent"):
+ backup_object_container.manage_addFolder(id=path,)
+ backup_object_container = backup_object_container._getOb(path)
+ else:
+ backup_object_container = backup_object_container.newContent(portal_type='Trash Folder', id=path,
+ is_indexable=0)
+ backup_object_container.edit(isHidden=1)
else:
backup_object_container = backup_object_container._getOb(path)
# backup the object
More information about the Erp5-report
mailing list