Commit e98c2e06 authored by Ayush Tiwari's avatar Ayush Tiwari Committed by Ayush Tiwari

erp5_catalog: Create erp5 catalog while setting up erp5site

parent 380a44a3
......@@ -1312,13 +1312,13 @@ class ObjectTemplateItem(BaseTemplateItem):
# The id match, but better double check with the meta type
# while avoiding the impact of systematic check
container_container = portal.unrestrictedTraverse(container_path[:-1])
if container_container.meta_type == 'ERP5 Catalog':
container_container.manage_addProduct['ZSQLCatalog'].manage_addSQLCatalog(id=container_path[-1], title='')
# We will have more than 1 objects in portal_catalog as we are
# adding both ERP5Catalog as well as SQLCatalog object here.
# Later on, this should be changed to use only ERP5Catalog object
if container_container.meta_type == 'Catalog Tool':
container_container.newContent(portal_type='Catalog', id=container_path[-1], title='')
if len(container_container.objectIds()) >= 1:
container_container.default_sql_catalog_id = container_path[-1]
container_container.setDefaultErp5CatalogId(container_path[-1])
elif container_container.meta_type == 'ERP5 Catalog':
container_container.manage_addProduct['ZSQLCatalog'].manage_addSQLCatalog(id=container_path[-1], title='')
container_container.default_sql_catalog_id == container_path[-1]
container = portal.unrestrictedTraverse(container_path)
else:
raise
......
......@@ -1979,10 +1979,8 @@ class ERP5Generator(PortalGenerator):
addERP5Tool(p, 'portal_caches', 'Cache Tool')
addERP5Tool(p, 'portal_memcached', 'Memcached Tool')
# Add ERP5 SQL Catalog Tool
addTool = p.manage_addProduct['ERP5Catalog'].manage_addTool
if not p.hasObject('portal_catalog'):
addTool('ERP5 Catalog', None)
# Add erp5 catalog tool
addERP5Tool(p, 'portal_catalog', 'Catalog Tool')
# Add Default SQL connection
if p.erp5_sql_connection_type == 'Z MySQL Database Connection':
......
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