Commit 897b4814 authored by Sebastien Robin's avatar Sebastien Robin

* Do not call ERP5Site_reindexAll any more when we install a

  site, this is useless
* postpone the installation of some tools in order to make
  sure they will be indexed
* manage_afterClone class reindexObjectSecurity that himself
  calls recursiveReindex, we do not want to recursive reindex
  when we install a new site, so we manually reindex objects
  (without recursive) when we install new object with bt, like
  this we remove duplicates of reindexing

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@29857 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent bc2a4e12
...@@ -904,7 +904,15 @@ class ObjectTemplateItem(BaseTemplateItem): ...@@ -904,7 +904,15 @@ class ObjectTemplateItem(BaseTemplateItem):
# mark a business template installation so in 'PortalType_afterClone' scripts # mark a business template installation so in 'PortalType_afterClone' scripts
# we can implement logical for reseting or not attributes (i.e reference). # we can implement logical for reseting or not attributes (i.e reference).
self.REQUEST.set('is_business_template_installation', 1) self.REQUEST.set('is_business_template_installation', 1)
# We set isIndexable to 0 before calling
# manage_afterClone in order to not call recursiveReindex, this is
# useless because we will already reindex every created object, so
# we avoid duplication of reindexation
obj.isIndexable = 0
obj.manage_afterClone(obj) obj.manage_afterClone(obj)
del obj.isIndexable
if getattr(aq_base(obj), 'reindexObject', None) is not None:
obj.reindexObject()
obj.wl_clearLocks() obj.wl_clearLocks()
if portal_type_dict: if portal_type_dict:
# set workflow chain # set workflow chain
......
...@@ -1451,6 +1451,19 @@ class ERP5Generator(PortalGenerator): ...@@ -1451,6 +1451,19 @@ class ERP5Generator(PortalGenerator):
keep = 0 keep = 0
portal_activities.manageClearActivities(keep=keep) portal_activities.manageClearActivities(keep=keep)
# Add several other tools, only at the end in order
# to make sure that they will be reindexed
addTool = p.manage_addProduct['ERP5'].manage_addTool
if not p.hasObject('portal_rules'):
addTool('ERP5 Rule Tool', None)
if not p.hasObject('portal_simulation'):
addTool('ERP5 Simulation Tool', None)
if not p.hasObject('portal_deliveries'):
addTool('ERP5 Delivery Tool', None)
if not p.hasObject('portal_orders'):
addTool('ERP5 Order Tool', None)
def setupTemplateTool(self, p, **kw): def setupTemplateTool(self, p, **kw):
""" """
Setup the Template Tool. Security must be set strictly. Setup the Template Tool. Security must be set strictly.
...@@ -1493,12 +1506,8 @@ class ERP5Generator(PortalGenerator): ...@@ -1493,12 +1506,8 @@ class ERP5Generator(PortalGenerator):
addTool = p.manage_addProduct['ERP5'].manage_addTool addTool = p.manage_addProduct['ERP5'].manage_addTool
if not p.hasObject('portal_categories'): if not p.hasObject('portal_categories'):
addTool('ERP5 Categories', None) addTool('ERP5 Categories', None)
if not p.hasObject('portal_rules'):
addTool('ERP5 Rule Tool', None)
if not p.hasObject('portal_ids'): if not p.hasObject('portal_ids'):
addTool('ERP5 Id Tool', None) addTool('ERP5 Id Tool', None)
if not p.hasObject('portal_simulation'):
addTool('ERP5 Simulation Tool', None)
if not p.hasObject('portal_templates'): if not p.hasObject('portal_templates'):
self.setupTemplateTool(p) self.setupTemplateTool(p)
if not p.hasObject('portal_trash'): if not p.hasObject('portal_trash'):
...@@ -1507,10 +1516,6 @@ class ERP5Generator(PortalGenerator): ...@@ -1507,10 +1516,6 @@ class ERP5Generator(PortalGenerator):
addTool('ERP5 Alarm Tool', None) addTool('ERP5 Alarm Tool', None)
if not p.hasObject('portal_domains'): if not p.hasObject('portal_domains'):
addTool('ERP5 Domain Tool', None) addTool('ERP5 Domain Tool', None)
if not p.hasObject('portal_deliveries'):
addTool('ERP5 Delivery Tool', None)
if not p.hasObject('portal_orders'):
addTool('ERP5 Order Tool', None)
if not p.hasObject('portal_tests'): if not p.hasObject('portal_tests'):
addTool('ERP5 Test Tool', None) addTool('ERP5 Test Tool', None)
if not p.hasObject('portal_password'): if not p.hasObject('portal_password'):
...@@ -1774,7 +1779,7 @@ class ERP5Generator(PortalGenerator): ...@@ -1774,7 +1779,7 @@ class ERP5Generator(PortalGenerator):
portal_catalog.getSQLCatalog().z0_drop_portal_ids() portal_catalog.getSQLCatalog().z0_drop_portal_ids()
# Then clear the catalog and reindex it # Then clear the catalog and reindex it
portal_catalog.manage_catalogClear() portal_catalog.manage_catalogClear()
skins_tool["erp5_core"].ERP5Site_reindexAll() # Calling ERP5Site_reindexAll is useless.
def setupUserFolder(self, p): def setupUserFolder(self, p):
# We use if possible ERP5Security, then NuxUserGroups # We use if possible ERP5Security, then NuxUserGroups
......
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