Commit 21011ec6 authored by Nicolas Dumazet's avatar Nicolas Dumazet

add erase_existing=False parameter to help users import their propertysheets


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@42966 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 12291655
...@@ -172,7 +172,8 @@ class PropertySheetTool(BaseTool): ...@@ -172,7 +172,8 @@ class PropertySheetTool(BaseTool):
security.declareProtected(Permissions.ManagePortal, security.declareProtected(Permissions.ManagePortal,
'createAllPropertySheetsFromFilesystem') 'createAllPropertySheetsFromFilesystem')
def createAllPropertySheetsFromFilesystem(self, REQUEST=None): def createAllPropertySheetsFromFilesystem(self, erase_existing=False,
REQUEST=None):
""" """
Create Property Sheets in portal_property_sheets from _all_ Create Property Sheets in portal_property_sheets from _all_
filesystem Property Sheets filesystem Property Sheets
...@@ -186,7 +187,7 @@ class PropertySheetTool(BaseTool): ...@@ -186,7 +187,7 @@ class PropertySheetTool(BaseTool):
if name[0] == '_': if name[0] == '_':
continue continue
if name in self.portal_property_sheets.objectIds(): if erase_existing and name in self.portal_property_sheets.objectIds():
self.portal_property_sheets.deleteContent(name) self.portal_property_sheets.deleteContent(name)
transaction.commit() transaction.commit()
......
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