Commit 5944dd2f authored by Ayush Tiwari's avatar Ayush Tiwari

erp5_catalog: Rename CatalogTool meta_type to ERP5 Catalogs from ERP5 Catalog to remove conflicts.

As this is a meta_type, I hope this naming is not breaking conventions of using plurals inside
ERP5. This renaming is required cause we are moving SQLCatalog to ERP5Catalog and we don't want
naming conflicts or confusions between CatalogTool(whose meta_type used to be ERP5 Catalog) and
ERP5Catalog class.
parent a668cf3c
...@@ -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 Catalog': if container_container.meta_type == 'ERP5 Catalogs':
container_container.manage_addProduct['ZSQLCatalog'].manage_addSQLCatalog(id=container_path[-1], title='') container_container.manage_addProduct['ZSQLCatalog'].manage_addSQLCatalog(id=container_path[-1], title='')
if len(container_container.objectIds()) == 1: if len(container_container.objectIds()) == 1:
container_container.default_sql_catalog_id = container_path[-1] container_container.default_sql_catalog_id = container_path[-1]
...@@ -1609,7 +1609,7 @@ class ObjectTemplateItem(BaseTemplateItem): ...@@ -1609,7 +1609,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 Catalog' and not len(container): if container.aq_parent.meta_type == 'ERP5 Catalogs' 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):
......
...@@ -309,7 +309,7 @@ class CatalogTool (ZCatalog, CMFCoreCatalogTool, BaseTool): ...@@ -309,7 +309,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 Catalog' meta_type = 'ERP5 Catalogs'
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