Commit f5a721cd authored by Ayush Tiwari's avatar Ayush Tiwari

erp5_catalog: New ERP5CatalogTool based on BaseTool from ERP5Type

Also, update in BusinessTemplate installation with changes in portal_catalog

Better to create new module for new Catalog Tool, as we don't
want a running instance to fail just because it is updated by
the new catalog code. This will maintain consistency in case
user doen't want to migrate to new catalog/catalog_tool

Most of the code for ERP5CatalogTool is copied from CatalogTool.
parent 5131c32b
......@@ -1313,7 +1313,10 @@ class ObjectTemplateItem(BaseTemplateItem):
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='')
if len(container_container.objectIds()) == 1:
# 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 len(container_container.objectIds()) >= 1:
container_container.default_sql_catalog_id = container_path[-1]
container = portal.unrestrictedTraverse(container_path)
else:
......
This diff is collapsed.
......@@ -38,9 +38,10 @@ document_classes = updateGlobals( this_module, globals(), permissions_module = P
# Define object classes and tools
from Tool import ArchiveTool
import ERP5Catalog, CatalogTool
import ERP5Catalog, CatalogTool, ERP5CatalogTool
object_classes = (ERP5Catalog.ERP5Catalog,)
portal_tools = (CatalogTool.CatalogTool,
ERP5CatalogTool.ERP5CatalogTool,
ArchiveTool.ArchiveTool)
content_classes = ()
content_constructors = ()
......
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