Commit 68df1e4c authored by iv's avatar iv

ERP5Workflow: during workflow conversion only setVariableValue if default_value

setVariableValue sets value to None if parameter is empty string
this breaks testWorkflowAndDCWorkflow and change the expected behaviour
take care that if someone saves a variable without editing this field, variable_value
may be None again
parent f98b6ed8
......@@ -524,7 +524,7 @@ class WorkflowTool(BaseTool, OriginalWorkflowTool):
interaction.setTriggerType(tdef.trigger_type)
interaction.setDescription(tdef.description)
# create variables (portal_type = Variable)
# create variables (portal_type = Workflow Variable)
for variable_id, variable_definition in dc_workflow.variables.items():
variable = workflow.newContent(portal_type='Workflow Variable', temp_object=is_temporary)
variable.setTitle(variable_definition.title)
......@@ -547,7 +547,8 @@ class WorkflowTool(BaseTool, OriginalWorkflowTool):
variable.setGuardExpression(tdef.info_guard.expr.text)
variable.setForCatalog(variable_definition.for_catalog)
variable.setStatusIncluded(variable_definition.for_status)
variable.setVariableValue(variable_definition.default_value)
if variable_definition.default_value:
variable.setVariableValue(variable_definition.default_value)
variable.setDescription(variable_definition.description)
# Configure transition variable:
if getattr(dc_workflow, 'transitions', None) is not 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