Commit b789f089 authored by Rafael Monnerat's avatar Rafael Monnerat

Fix workflow initialization when workflow_history is not present yet.

parent 25c6d206
......@@ -97,10 +97,11 @@ class BusinessConfiguration(Item):
def initializeWorkflow(self):
""" Initialize Related Workflow"""
workflow = self.getResourceValue()
workflow_history = getattr(self, 'workflow_history', None)
if workflow is not None and \
workflow_history is not None and \
(self.getResource() not in workflow_history):
workflow_history = getattr(self, 'workflow_history', {})
if workflow is None:
return
if self.getResource() not in workflow_history:
if len(self.objectValues("ERP5 Configuration Save")) > 0:
raise ValueError("Business Configuration Cannot be initialized, \
it contains one or more Configurator Save")
......
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