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):
# mark a business template installation so in 'PortalType_afterClone' scripts
# we can implement logical for reseting or not attributes (i.e reference).
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)
del obj.isIndexable
if getattr(aq_base(obj), 'reindexObject', None) is not None:
obj.reindexObject()
obj.wl_clearLocks()
if portal_type_dict:
# set workflow chain
......
......@@ -1451,6 +1451,19 @@ class ERP5Generator(PortalGenerator):
keep = 0
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):
"""
Setup the Template Tool. Security must be set strictly.
......@@ -1493,12 +1506,8 @@ class ERP5Generator(PortalGenerator):
addTool = p.manage_addProduct['ERP5'].manage_addTool
if not p.hasObject('portal_categories'):
addTool('ERP5 Categories', None)
if not p.hasObject('portal_rules'):
addTool('ERP5 Rule Tool', None)
if not p.hasObject('portal_ids'):
addTool('ERP5 Id Tool', None)
if not p.hasObject('portal_simulation'):
addTool('ERP5 Simulation Tool', None)
if not p.hasObject('portal_templates'):
self.setupTemplateTool(p)
if not p.hasObject('portal_trash'):
......@@ -1507,10 +1516,6 @@ class ERP5Generator(PortalGenerator):
addTool('ERP5 Alarm Tool', None)
if not p.hasObject('portal_domains'):
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'):
addTool('ERP5 Test Tool', None)
if not p.hasObject('portal_password'):
......@@ -1774,7 +1779,7 @@ class ERP5Generator(PortalGenerator):
portal_catalog.getSQLCatalog().z0_drop_portal_ids()
# Then clear the catalog and reindex it
portal_catalog.manage_catalogClear()
skins_tool["erp5_core"].ERP5Site_reindexAll()
# Calling ERP5Site_reindexAll is useless.
def setupUserFolder(self, p):
# 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