Commit d0b9f98b authored by Ayush Tiwari's avatar Ayush Tiwari Committed by Ayush Tiwari

BusineeTemplate: Add fixes for Business Manager installation to work with BT...

BusineeTemplate: Add fixes for Business Manager installation to work with BT installation during bootstrap
parent 16100b46
...@@ -2531,8 +2531,13 @@ class PortalTypeWorkflowChainTemplateItem(BaseTemplateItem): ...@@ -2531,8 +2531,13 @@ class PortalTypeWorkflowChainTemplateItem(BaseTemplateItem):
force = kw.get('force') force = kw.get('force')
installed_bt = kw.get('installed_bt') installed_bt = kw.get('installed_bt')
if installed_bt is not None: if installed_bt is not None:
try:
previous_portal_type_workflow_chain_list = list(installed_bt\ previous_portal_type_workflow_chain_list = list(installed_bt\
.getTemplatePortalTypeWorkflowChainList()) .getTemplatePortalTypeWorkflowChainList())
except Exception:
# This will happen in case the `installed_bt` is Business Manager, so
# we won't need to goto the further installation process
return
else: else:
previous_portal_type_workflow_chain_list = [] previous_portal_type_workflow_chain_list = []
# We now need to setup the list of workflows corresponding to # We now need to setup the list of workflows corresponding to
...@@ -4308,15 +4313,8 @@ class DocumentTemplateItem(FilesystemToZodbTemplateItem): ...@@ -4308,15 +4313,8 @@ class DocumentTemplateItem(FilesystemToZodbTemplateItem):
""" """
if self._is_already_migrated(self._objects.keys()): if self._is_already_migrated(self._objects.keys()):
ObjectTemplateItem.install(self, context, **kw) ObjectTemplateItem.install(self, context, **kw)
# Reset component on the fly, because it is possible that those self.portal_components.reset(force=True,
# components are required in the middle of the transaction. For example: reset_portal_type_at_transaction_boundary=True)
# - A method in a component is called while installing.
# - A document component is used in a different business template,
# and those business templates are installed in a single transaction
# by upgrader.
# This reset is called at most 3 times in one business template
# installation. (for Document, Test, Extension)
self.portal_components.reset(force=True)
else: else:
FilesystemDocumentTemplateItem.install(self, context, **kw) FilesystemDocumentTemplateItem.install(self, context, **kw)
...@@ -5349,6 +5347,9 @@ Business Template is a set of definitions, such as skins, portal types and categ ...@@ -5349,6 +5347,9 @@ Business Template is a set of definitions, such as skins, portal types and categ
# always created a trash bin because we may to save object already present # always created a trash bin because we may to save object already present
# but not in a previous business templates apart at creation of a new site # but not in a previous business templates apart at creation of a new site
if trash_tool is not None and (len(object_to_update) > 0 or len(self.portal_templates) > 2): if trash_tool is not None and (len(object_to_update) > 0 or len(self.portal_templates) > 2):
if self.title == 'erp5_core':
trashbin = None
else:
trashbin = trash_tool.newTrashBin(self.getTitle(), self) trashbin = trash_tool.newTrashBin(self.getTitle(), self)
else: else:
trashbin = None trashbin = None
......
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