Commit 4bac70fa authored by Christophe Dumez's avatar Christophe Dumez

- Added a revision number which is updated at each build


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@8315 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 7d8f946e
...@@ -1225,7 +1225,11 @@ class PortalTypeWorkflowChainTemplateItem(BaseTemplateItem): ...@@ -1225,7 +1225,11 @@ class PortalTypeWorkflowChainTemplateItem(BaseTemplateItem):
action = update_dict[path] action = update_dict[path]
if action == 'nothing': if action == 'nothing':
continue continue
portal_type = path.split('/', 1)[1] path_splitted = path.split('/', 1)
# XXX: to avoid crashing when no portal_type
if len(path_splitted) < 2:
continue
portal_type = path_splitted[1]
if chain_dict.has_key('chain_%s' % portal_type): if chain_dict.has_key('chain_%s' % portal_type):
old_chain_dict = chain_dict['chain_%s' % portal_type] old_chain_dict = chain_dict['chain_%s' % portal_type]
# XXX we don't use the chain (Default) in erp5 so don't keep it # XXX we don't use the chain (Default) in erp5 so don't keep it
...@@ -3648,6 +3652,16 @@ Business Template is a set of definitions, such as skins, portal types and categ ...@@ -3648,6 +3652,16 @@ Business Template is a set of definitions, such as skins, portal types and categ
self.workflow_history[ self.workflow_history[
'business_template_installation_workflow'] = None 'business_template_installation_workflow'] = None
def updateRevisionNumber(self):
""" incremente bt revision number
"""
revision_number = self.getRevision()
if revision_number is None or revision_number.strip() == '':
revision_number = 1
else:
revision_number = int(revision_number)+1
self.setRevision(revision_number)
security.declareProtected(Permissions.ManagePortal, 'build') security.declareProtected(Permissions.ManagePortal, 'build')
def build(self, no_action=0): def build(self, no_action=0):
""" """
...@@ -3656,11 +3670,14 @@ Business Template is a set of definitions, such as skins, portal types and categ ...@@ -3656,11 +3670,14 @@ Business Template is a set of definitions, such as skins, portal types and categ
if no_action: return # this is use at import of Business Template to get the status built if no_action: return # this is use at import of Business Template to get the status built
# Make sure that everything is sane. # Make sure that everything is sane.
self.clean() self.clean()
# Set the format version. # Update revision number
# <christophe@nexedi.com>
self.updateRevisionNumber()
self._setTemplateFormatVersion(1) self._setTemplateFormatVersion(1)
# Store all datas # Store all data
self._portal_type_item = \ self._portal_type_item = \
PortalTypeTemplateItem(self.getTemplatePortalTypeIdList()) PortalTypeTemplateItem(self.getTemplatePortalTypeIdList())
self._portal_type_workflow_chain_item = \ self._portal_type_workflow_chain_item = \
......
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