Commit 18e10606 authored by Ayush Tiwari's avatar Ayush Tiwari

erp5_catalog: New Catalog for ERP5.

We try to move from using SQLCatalog to ERP5Catalog as the default Catlaog inside
ERP5. The major difference is use of Folder class as the base for Catalog from
Products.ERP5Type.Core
parent da19da73
...@@ -1313,9 +1313,16 @@ class ObjectTemplateItem(BaseTemplateItem): ...@@ -1313,9 +1313,16 @@ class ObjectTemplateItem(BaseTemplateItem):
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 == '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='')
# Add ERP5Catalog object which will be further used as new Catalog
# instead of the SQLCatalog we used earlier
container_path_new = container_path[-1]+'_new'
container_container.manage_addProduct['ERP5Catalog'].manage_addERP5Catalog(id=erp5_catalog_id, 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]
container = portal.unrestrictedTraverse(container_path) # Try installing ERP5Catalog instead of SQLCatalog
# Still in development phase, we are not completely remove the
# dependency on SQLCatlaog
container = portal.unrestrictedTraverse(container_path_new)
else: else:
raise raise
saved_uid_dict = {} saved_uid_dict = {}
......
This source diff could not be displayed because it is too large. You can view the blob instead.
...@@ -38,8 +38,8 @@ document_classes = updateGlobals( this_module, globals(), permissions_module = P ...@@ -38,8 +38,8 @@ document_classes = updateGlobals( this_module, globals(), permissions_module = P
# Define object classes and tools # Define object classes and tools
from Tool import ArchiveTool from Tool import ArchiveTool
import CatalogTool import ERP5Catalog, CatalogTool
object_classes = () object_classes = (ERP5Catalog.ERP5Catalog,)
portal_tools = (CatalogTool.CatalogTool, portal_tools = (CatalogTool.CatalogTool,
ArchiveTool.ArchiveTool) ArchiveTool.ArchiveTool)
content_classes = () content_classes = ()
......
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