Commit 658dd8de authored by Ayush Tiwari's avatar Ayush Tiwari

erp5_catalog: Chnage CatalogTool meta_type to 'Catalog Tool'

parent 13e3a750
...@@ -1311,7 +1311,7 @@ class ObjectTemplateItem(BaseTemplateItem): ...@@ -1311,7 +1311,7 @@ class ObjectTemplateItem(BaseTemplateItem):
# The id match, but better double check with the meta type # The id match, but better double check with the meta type
# while avoiding the impact of systematic check # while avoiding the impact of systematic check
container_container = portal.unrestrictedTraverse(container_path[:-1]) container_container = portal.unrestrictedTraverse(container_path[:-1])
if container_container.meta_type == 'ERP5 Catalogs': if container_container.meta_type == 'Catalog Tool':
container_container.manage_addProduct['ZSQLCatalog'].manage_addSQLCatalog(id=container_path[-1], title='') container_container.manage_addProduct['ZSQLCatalog'].manage_addSQLCatalog(id=container_path[-1], title='')
# Create a new container path list for the ERP5Catalog object # Create a new container path list for the ERP5Catalog object
container_path_new = list(container_path) container_path_new = list(container_path)
...@@ -1618,7 +1618,7 @@ class ObjectTemplateItem(BaseTemplateItem): ...@@ -1618,7 +1618,7 @@ class ObjectTemplateItem(BaseTemplateItem):
container.getSkinSelections()) container.getSkinSelections())
container.manage_delObjects([object_id]) container.manage_delObjects([object_id])
if container.aq_parent.meta_type == 'ERP5 Catalogs' and not len(container): if container.aq_parent.meta_type == 'Catalog Tool' and not len(container):
# We are removing a ZSQLMethod, remove the SQLCatalog if empty # We are removing a ZSQLMethod, remove the SQLCatalog if empty
container.getParentValue().manage_delObjects([container.id]) container.getParentValue().manage_delObjects([container.id])
except (NotFound, KeyError, BadRequest, AttributeError): except (NotFound, KeyError, BadRequest, AttributeError):
......
...@@ -311,7 +311,7 @@ class CatalogTool (ZCatalog, CMFCoreCatalogTool, BaseTool): ...@@ -311,7 +311,7 @@ class CatalogTool (ZCatalog, CMFCoreCatalogTool, BaseTool):
It is based on ZSQLCatalog It is based on ZSQLCatalog
""" """
id = 'portal_catalog' id = 'portal_catalog'
meta_type = 'ERP5 Catalogs' meta_type = 'Catalog Tool'
portal_type = 'Catalog Tool' portal_type = 'Catalog Tool'
allowed_types = ('Catalog',) allowed_types = ('Catalog',)
security = ClassSecurityInfo() security = ClassSecurityInfo()
......
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