Commit feef636c authored by Ayush Tiwari's avatar Ayush Tiwari

erp5_catalog: Create portal_type dynamic object for new erp5_catalog object while migration

parent e7a47e6c
......@@ -1716,9 +1716,9 @@ class ERP5Site(FolderMixIn, CMFSite, CacheCookieMixin):
if not isinstance(sql_catalog, ERP5Catalog):
if erp5_catalog_id not in catalog_tool.objectIds():
# Create new ERP5Catalog object if it doesn't exist
catalog_tool.manage_addProduct['ERP5Catalog'].manage_addERP5Catalog(
id = erp5_catalog_id,
title = '')
catalog_tool.newContent(portal_type='Catalog',
id = erp5_catalog_id,
title='')
# Update default erp5 catalog id, the first time we run create ..
# ERP5Catalog object.
catalog_tool.default_erp5_catalog_id = erp5_catalog_id
......@@ -1745,6 +1745,7 @@ class ERP5Site(FolderMixIn, CMFSite, CacheCookieMixin):
# Update properties list for the new catalog from the SQLCatalog
# Not an efficient way to carry this
for property_id in sql_catalog.propertyIds():
#import pdb; pdb.set_trace()
# This is needed because there have been problems with setting property
# for title, see this docstring for explanations:
# https://lab.nexedi.com/nexedi/erp5/blob/198df7021a17725e81ab930015c3c618e94263db/product/ERP5Type/Base.py#L3531
......@@ -2290,6 +2291,7 @@ class ERP5Generator(PortalGenerator):
addERP5Tool(p, 'portal_activities', 'Activity Tool')
# CatalogTool has been included inside ERP5. So, prefer using addERP5Tool
# instead of using addTool on Catalog Tool object.
addERP5Tool(p, 'portal_catalog', 'Catalog Tool')
# Initialize Activities
p.portal_activities.manageClearActivities()
......@@ -2302,7 +2304,7 @@ class ERP5Generator(PortalGenerator):
if not p.hasObject('content_type_registry'):
self.setupMimetypes(p)
#import pdb; pdb.set_trace()
if not update:
self.setupWorkflow(p)
self.setupERP5Core(p,**kw)
......
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