Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
erp5
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
2
Merge Requests
2
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Cédric Le Ninivin
erp5
Commits
297150fc
Commit
297150fc
authored
Dec 08, 2022
by
Eteri
Browse files
Options
Browse Files
Download
Plain Diff
Fix workflow bug "Local variable 'value' referenced before assignment"
See merge request
nexedi/erp5!1704
parents
b8e27caf
133118fc
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
0 deletions
+17
-0
bt5/erp5_core_test/TestTemplateItem/portal_components/test.erp5.testERP5Workflow.py
...plateItem/portal_components/test.erp5.testERP5Workflow.py
+16
-0
product/ERP5Type/Core/Workflow.py
product/ERP5Type/Core/Workflow.py
+1
-0
No files found.
bt5/erp5_core_test/TestTemplateItem/portal_components/test.erp5.testERP5Workflow.py
View file @
297150fc
...
...
@@ -131,6 +131,22 @@ class TestERP5Workflow(ERP5TypeTestCase):
history
=
doc
.
workflow_history
[
'wf'
]
self
.
assertEqual
(
len
(
history
),
2
)
# create, transition1
transition_variable
=
transition1
.
newContent
(
portal_type
=
'Workflow Transition Variable'
,
causality_value
=
variable1
,
variable_default_expression
=
'string:Set by transition variable'
,
)
workflow
.
_executeTransition
(
doc
,
transition1
)
self
.
assertEqual
(
workflow
.
getCurrentStatusDict
(
doc
)[
'variable1'
],
"Set by transition variable"
)
# Without an expression, the variable is set to None
transition_variable
.
setVariableDefaultExpression
(
None
)
workflow
.
_executeTransition
(
doc
,
transition1
)
self
.
assertEqual
(
workflow
.
getCurrentStatusDict
(
doc
)[
'variable1'
],
None
)
def
test_afterScript
(
self
):
...
...
product/ERP5Type/Core/Workflow.py
View file @
297150fc
...
...
@@ -860,6 +860,7 @@ class Workflow(XMLObject):
continue
expr
=
None
value
=
None
if
variable_id
in
transition_expression_dict
:
expr
=
transition_expression_dict
[
variable_id
]
elif
not
vdef
.
getAutomaticUpdate
()
and
variable_reference
in
former_status
:
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment