Commit 7e4757d2 authored by Sebastien Robin's avatar Sebastien Robin

ERP5Workflow: avoid to add more getToolByName

parent de899bbd
...@@ -2410,7 +2410,7 @@ class PortalTypeWorkflowChainTemplateItem(BaseTemplateItem): ...@@ -2410,7 +2410,7 @@ class PortalTypeWorkflowChainTemplateItem(BaseTemplateItem):
# if nothing or +, chain is added to the existing one # if nothing or +, chain is added to the existing one
# if - chain is removed from the exisiting one # if - chain is removed from the exisiting one
# if = chain replaced the existing one # if = chain replaced the existing one
types_tool = getToolByName(self.getPortalObject(), 'portal_types') types_tool = self.getPortalObject().portal_types
for key in self._archive.keys(): for key in self._archive.keys():
wflist = key.split(' | ') wflist = key.split(' | ')
if len(wflist) == 2: if len(wflist) == 2:
...@@ -2474,7 +2474,7 @@ class PortalTypeWorkflowChainTemplateItem(BaseTemplateItem): ...@@ -2474,7 +2474,7 @@ class PortalTypeWorkflowChainTemplateItem(BaseTemplateItem):
update_dict = kw.get('object_to_update') update_dict = kw.get('object_to_update')
force = kw.get('force') force = kw.get('force')
installed_bt = kw.get('installed_bt') installed_bt = kw.get('installed_bt')
types_tool = getToolByName(self.getPortalObject(), 'portal_types') types_tool = self.getPortalObject().portal_types
changed = False changed = False
if installed_bt is not None: if installed_bt is not None:
previous_portal_type_workflow_chain_list = list(installed_bt\ previous_portal_type_workflow_chain_list = list(installed_bt\
...@@ -2554,7 +2554,7 @@ class PortalTypeWorkflowChainTemplateItem(BaseTemplateItem): ...@@ -2554,7 +2554,7 @@ class PortalTypeWorkflowChainTemplateItem(BaseTemplateItem):
self._resetDynamicModules() self._resetDynamicModules()
def uninstall(self, context, **kw): def uninstall(self, context, **kw):
types_tool = getToolByName(self.getPortalObject(), 'portal_types') types_tool = self.getPortalObject().portal_types
object_path = kw.get('object_path', None) object_path = kw.get('object_path', None)
if object_path is not None: if object_path is not None:
object_key_list = [object_path] object_key_list = [object_path]
......
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