diff --git a/product/ERP5/Document/BusinessTemplate.py b/product/ERP5/Document/BusinessTemplate.py index 14e83fc5d5119a883b12bd596715b01392ea3afa..a5c6aa88e8a9494dc42baf777023154a7f01deed 100644 --- a/product/ERP5/Document/BusinessTemplate.py +++ b/product/ERP5/Document/BusinessTemplate.py @@ -5179,8 +5179,12 @@ Business Template is a set of definitions, such as skins, portal types and categ gen = generator_class() # update activity tool first if necessary if self.getTitle() == 'erp5_core' and self.getTemplateUpdateTool(): - LOG('Business Template', 0, 'Updating Activity Tool') - gen.setupLastTools(site, update=1, create_activities=1) + if not site.hasObject('portal_activities'): + 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 len(object_to_update) == 0: # check if we have to update tools diff --git a/product/ERP5/ERP5Site.py b/product/ERP5/ERP5Site.py index e9923c632955a0ea56e3c85860ac104058cabde7..6b4c034edcd8dc8c1910915cfbb77bdb3e388b48 100644 --- a/product/ERP5/ERP5Site.py +++ b/product/ERP5/ERP5Site.py @@ -62,7 +62,7 @@ def manage_addERP5Site(self, title='ERP5', description='', create_userfolder=1, - create_activities=1, + create_activities=True, email_from_address='postmaster@localhost', email_from_name='Portal Administrator', validate_email=0, @@ -1432,7 +1432,7 @@ class ERP5Generator(PortalGenerator): erp5_sql_deferred_connection_type, cmf_activity_sql_connection_type, cmf_activity_sql_connection_string, - create_activities=1, + create_activities=True, reindex=1, **kw): id = str(id) @@ -1471,7 +1471,7 @@ class ERP5Generator(PortalGenerator): make sure that we do not put un the queue the full reindexation """ # 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'): addTool = p.manage_addProduct['CMFActivity'].manage_addTool addTool('CMF Activity Tool', None) # Allow user to select active/passive