Commit c0ac0986 authored by Aurel's avatar Aurel

do not recreate catalog at update of tools


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@4963 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent b665a4d4
...@@ -707,10 +707,11 @@ class ERP5Generator(PortalGenerator): ...@@ -707,10 +707,11 @@ class ERP5Generator(PortalGenerator):
PortalGenerator.setupTools(self, p) PortalGenerator.setupTools(self, p)
# It is better to remove portal_catalog which is ZCatalog as soon as possible, # It is better to remove portal_catalog which is ZCatalog as soon as possible,
# because the API is not the completely same as ERP5Catalog, and ZCatalog is # because the API is not the completely same as ERP5Catalog, and ZCatalog is
# useless for ERP5 after all. # useless for ERP5 after all.
update = kw.get('update', 0)
portal_catalog = getToolByName(p, 'portal_catalog', None) portal_catalog = getToolByName(p, 'portal_catalog', None)
if portal_catalog is not None and portal_catalog.meta_type != 'ZSQLCatalog': if portal_catalog is not None and portal_catalog.meta_type != 'ZSQLCatalog' and not update:
p._delObject('portal_catalog') p._delObject('portal_catalog')
# Add CMF Report Tool # Add CMF Report Tool
...@@ -768,12 +769,12 @@ class ERP5Generator(PortalGenerator): ...@@ -768,12 +769,12 @@ class ERP5Generator(PortalGenerator):
pass pass
# Create default methods in Catalog XXX # Create default methods in Catalog XXX
portal_catalog = getToolByName(p, 'portal_catalog') portal_catalog = getToolByName(p, 'portal_catalog')
if not portal_catalog.getSQLCatalog('erp5_mysql'): if not portal_catalog.getSQLCatalog('erp5_mysql') and not update:
# FIXME: addDefaultSQLMethods should be removed. # FIXME: addDefaultSQLMethods should be removed.
portal_catalog.addDefaultSQLMethods('erp5_mysql') portal_catalog.addDefaultSQLMethods('erp5_mysql')
# Clear Catalog # Clear Catalog
portal_catalog.manage_catalogClear() portal_catalog.manage_catalogClear()
# Add ERP5Form Tools # Add ERP5Form Tools
addTool = p.manage_addProduct['ERP5Form'].manage_addTool addTool = p.manage_addProduct['ERP5Form'].manage_addTool
......
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