Commit c67a462b authored by Ayush Tiwari's avatar Ayush Tiwari

multiple_catalog: Update validation state of the default catalog

parent 6754f934
......@@ -1315,6 +1315,10 @@ class ObjectTemplateItem(BaseTemplateItem):
# Check for meta_type of container before creating Catalog
if container_container.meta_type == 'Catalog Tool':
container_container.newContent(portal_type='Catalog', id=container_path[-1], title='')
if len(container_container.objectIds()) >= 1:
container_container.setDefaultErp5CatalogId(container_path[-1])
# Validate the default erp5 catalog
container_container.getSQLCatalog().validate()
elif container_container.meta_type == 'ERP5 Catalog':
container_container.manage_addProduct['ZSQLCatalog'].manage_addSQLCatalog(id=container_path[-1], title='')
else:
......
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