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
Levin Zimmermann
erp5
Commits
2e15c269
Commit
2e15c269
authored
May 18, 2015
by
wenjie.zheng
Committed by
Sebastien Robin
Jul 16, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ERP5WorkflowTool.py: correct logic error; add universal methods.
parent
59deb20f
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
3 deletions
+21
-3
product/ERP5/Tool/ERP5WorkflowTool.py
product/ERP5/Tool/ERP5WorkflowTool.py
+21
-3
No files found.
product/ERP5/Tool/ERP5WorkflowTool.py
View file @
2e15c269
...
@@ -129,7 +129,7 @@ class ERP5WorkflowTool(BaseTool, OriginalWorkflowTool):
...
@@ -129,7 +129,7 @@ class ERP5WorkflowTool(BaseTool, OriginalWorkflowTool):
raise
WorkflowException
(
'No workflows found.'
)
raise
WorkflowException
(
'No workflows found.'
)
found
=
False
found
=
False
for
workflow
in
workflow_list
:
for
workflow
in
workflow_list
:
if
not
isinstance
(
workflow
,
InteractionWorkflowDefinition
)
or
\
if
not
isinstance
(
workflow
,
InteractionWorkflowDefinition
)
and
\
not
isinstance
(
workflow
,
InteractionWorkflow
):
not
isinstance
(
workflow
,
InteractionWorkflow
):
if
state_id
in
workflow
.
getStateIdList
():
if
state_id
in
workflow
.
getStateIdList
():
found
=
True
found
=
True
...
@@ -151,7 +151,7 @@ class ERP5WorkflowTool(BaseTool, OriginalWorkflowTool):
...
@@ -151,7 +151,7 @@ class ERP5WorkflowTool(BaseTool, OriginalWorkflowTool):
from
Products.ERP5.InteractionWorkflow
import
InteractionWorkflowDefinition
from
Products.ERP5.InteractionWorkflow
import
InteractionWorkflowDefinition
from
Products.ERP5Workflow.Document.InteractionWorkflow
import
InteractionWorkflow
from
Products.ERP5Workflow.Document.InteractionWorkflow
import
InteractionWorkflow
for
workflow
in
(
wf_id
and
(
self
[
wf_id
],)
or
self
.
getWorkflowValueListFor
(
ob
.
getPortalType
())):
for
workflow
in
(
wf_id
and
(
self
[
wf_id
],)
or
self
.
getWorkflowValueListFor
(
ob
.
getPortalType
())):
if
not
isinstance
(
workflow
,
InteractionWorkflowDefinition
)
or
\
if
not
isinstance
(
workflow
,
InteractionWorkflowDefinition
)
and
\
not
isinstance
(
workflow
,
InteractionWorkflow
):
not
isinstance
(
workflow
,
InteractionWorkflow
):
if
state_id
in
workflow
.
getStateIdList
():
if
state_id
in
workflow
.
getStateIdList
():
return
True
return
True
...
@@ -243,6 +243,24 @@ class ERP5WorkflowTool(BaseTool, OriginalWorkflowTool):
...
@@ -243,6 +243,24 @@ class ERP5WorkflowTool(BaseTool, OriginalWorkflowTool):
workflow_list
.
append
(
wf
)
workflow_list
.
append
(
wf
)
return
workflow_list
return
workflow_list
security
.
declarePrivate
(
'getHistoryOf'
)
def
getHistoryOf
(
self
,
wf_id
,
ob
):
""" Get the history of an object for a given workflow.
"""
if
hasattr
(
aq_base
(
ob
),
'workflow_history'
):
wfh
=
ob
.
workflow_history
return
wfh
.
get
(
wf_id
,
None
)
return
()
security
.
declarePrivate
(
'getStatusOf'
)
def
getStatusOf
(
self
,
wf_id
,
ob
):
""" Get the last element of a workflow history for a given workflow.
"""
wfh
=
self
.
getHistoryOf
(
wf_id
,
ob
)
if
wfh
:
return
wfh
[
-
1
]
return
None
def
dc_workflow_asERP5Object
(
self
,
container
,
dc_workflow
,
temp
):
def
dc_workflow_asERP5Object
(
self
,
container
,
dc_workflow
,
temp
):
# create a temporary ERP5 Workflow
# create a temporary ERP5 Workflow
workflow_type_id
=
dc_workflow
.
__class__
.
__name__
workflow_type_id
=
dc_workflow
.
__class__
.
__name__
...
...
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