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
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Léo-Paul Géneau
erp5
Commits
4902bfab
Commit
4902bfab
authored
Nov 19, 2021
by
Xiaowu Zhang
Browse files
Options
Browse Files
Download
Plain Diff
product/Workflow&erp5_workflow_test: fix can't access workflow state after change State Variable
See merge request
nexedi/erp5!1509
parents
ca222675
37fbef7d
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
3 deletions
+16
-3
bt5/erp5_workflow_test/TestTemplateItem/portal_components/test.erp5.testWorkflowAndDCWorkflow.py
.../portal_components/test.erp5.testWorkflowAndDCWorkflow.py
+11
-0
product/ERP5Type/Core/Workflow.py
product/ERP5Type/Core/Workflow.py
+5
-3
No files found.
bt5/erp5_workflow_test/TestTemplateItem/portal_components/test.erp5.testWorkflowAndDCWorkflow.py
View file @
4902bfab
...
...
@@ -14,6 +14,7 @@ class TestERP5WorkflowMixin(TestWorkflowMixin):
module
=
self
.
portal
.
workflow_test_module
module
.
manage_delObjects
(
list
(
module
.
objectIds
()))
self
.
portal
.
portal_workflow
[
self
.
initial_dc_workflow_id
].
setStateVariable
(
'validation_state'
)
self
.
copyWorkflow
(
self
.
portal
.
portal_workflow
,
self
.
initial_dc_workflow_id
,
self
.
workflow_id
)
self
.
copyWorkflow
(
self
.
portal
.
portal_workflow
,
self
.
initial_dc_interaction_workflow_id
,
self
.
interaction_workflow_id
)
...
...
@@ -191,6 +192,16 @@ class TestERP5WorkflowMixin(TestWorkflowMixin):
self
.
checkDocumentState
(
new_object
,
'validated'
)
self
.
assertEqual
(
workflow_tool
.
isTransitionPossible
(
new_object
,
'invalidate'
),
1
)
def
test_13_testAccessWorkflowStateAfterChangeStateVariable
(
self
):
new_object
=
self
.
getTestObject
()
self
.
tic
()
self
.
assertEqual
(
new_object
.
getValidationState
(),
'draft'
)
self
.
portal
.
portal_workflow
[
self
.
initial_dc_workflow_id
].
setStateVariable
(
'simulation_state'
)
self
.
portal
.
portal_workflow
[
self
.
workflow_id
].
setStateVariable
(
'simulation_state'
)
self
.
tic
()
self
.
assertEqual
(
new_object
.
getSimulationState
(),
'draft'
)
self
.
tic
()
class
TestConvertedWorkflow
(
TestERP5WorkflowMixin
):
"""
Tests Converted Workflow which generated dynamically from DCWorkflow.
...
...
product/ERP5Type/Core/Workflow.py
View file @
4902bfab
...
...
@@ -606,9 +606,11 @@ class Workflow(XMLObject):
if
status
is
None
:
state
=
self
.
getSourceValue
()
else
:
state_id
=
'state_'
+
status
.
get
(
self
.
getStateVariable
(),
None
)
state_parameter
=
status
.
get
(
self
.
getStateVariable
(),
None
)
if
state_parameter
:
state_id
=
'state_'
+
state_parameter
state
=
self
.
_getOb
(
state_id
)
if
state
is
None
:
if
(
state_parameter
is
None
)
or
(
state
is
None
)
:
state
=
self
.
getSourceValue
()
if
id_only
:
if
state
is
None
:
...
...
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