Commit 5ffc0eda authored by Nicolas Delaby's avatar Nicolas Delaby

Avoid clearing activities if portal_actvities already exists.

This is the responsability of site Manager to recreate Activity SQL Table
if their structure change.
Reviewed by Aurel


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@32743 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 9834697f
...@@ -5179,8 +5179,12 @@ Business Template is a set of definitions, such as skins, portal types and categ ...@@ -5179,8 +5179,12 @@ Business Template is a set of definitions, such as skins, portal types and categ
gen = generator_class() gen = generator_class()
# update activity tool first if necessary # update activity tool first if necessary
if self.getTitle() == 'erp5_core' and self.getTemplateUpdateTool(): if self.getTitle() == 'erp5_core' and self.getTemplateUpdateTool():
LOG('Business Template', 0, 'Updating Activity Tool') if not site.hasObject('portal_activities'):
gen.setupLastTools(site, update=1, create_activities=1) create_activities = True
LOG('Business Template', 0, 'Updating Activity Tool')
else:
create_activities = False
gen.setupLastTools(site, update=1, create_activities=create_activities)
if not force: if not force:
if len(object_to_update) == 0: if len(object_to_update) == 0:
# check if we have to update tools # check if we have to update tools
......
...@@ -62,7 +62,7 @@ def manage_addERP5Site(self, ...@@ -62,7 +62,7 @@ def manage_addERP5Site(self,
title='ERP5', title='ERP5',
description='', description='',
create_userfolder=1, create_userfolder=1,
create_activities=1, create_activities=True,
email_from_address='postmaster@localhost', email_from_address='postmaster@localhost',
email_from_name='Portal Administrator', email_from_name='Portal Administrator',
validate_email=0, validate_email=0,
...@@ -1432,7 +1432,7 @@ class ERP5Generator(PortalGenerator): ...@@ -1432,7 +1432,7 @@ class ERP5Generator(PortalGenerator):
erp5_sql_deferred_connection_type, erp5_sql_deferred_connection_type,
cmf_activity_sql_connection_type, cmf_activity_sql_connection_type,
cmf_activity_sql_connection_string, cmf_activity_sql_connection_string,
create_activities=1, create_activities=True,
reindex=1, reindex=1,
**kw): **kw):
id = str(id) id = str(id)
...@@ -1471,7 +1471,7 @@ class ERP5Generator(PortalGenerator): ...@@ -1471,7 +1471,7 @@ class ERP5Generator(PortalGenerator):
make sure that we do not put un the queue the full reindexation make sure that we do not put un the queue the full reindexation
""" """
# Add Activity Tool # Add Activity Tool
if kw.has_key('create_activities') and int(kw['create_activities'])==1: if kw.get('create_activities', False):
if not p.hasObject('portal_activities'): if not p.hasObject('portal_activities'):
addTool = p.manage_addProduct['CMFActivity'].manage_addTool addTool = p.manage_addProduct['CMFActivity'].manage_addTool
addTool('CMF Activity Tool', None) # Allow user to select active/passive addTool('CMF Activity Tool', None) # Allow user to select active/passive
......
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