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
Matevz Golob
erp5
Commits
018c8010
Commit
018c8010
authored
Jul 20, 2015
by
wenjie.zheng
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
WorkflowTool.py: fix worklist related unit tests failure; add commentaries.
parent
3c9a222c
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
25 additions
and
14 deletions
+25
-14
product/ERP5/Tool/WorkflowTool.py
product/ERP5/Tool/WorkflowTool.py
+25
-14
No files found.
product/ERP5/Tool/WorkflowTool.py
View file @
018c8010
...
@@ -191,15 +191,18 @@ class WorkflowTool(BaseTool, OriginalWorkflowTool):
...
@@ -191,15 +191,18 @@ class WorkflowTool(BaseTool, OriginalWorkflowTool):
workflow_list
,
ob
,
action
,
wf
.
doActionFor
,
(
ob
,
action
)
+
args
,
kw
)
workflow_list
,
ob
,
action
,
wf
.
doActionFor
,
(
ob
,
action
)
+
args
,
kw
)
def
getWorkflowValueListFor
(
self
,
portal_type_id
):
def
getWorkflowValueListFor
(
self
,
portal_type_id
):
""" Return a list of workflows bound to selected portal_type.
""" Return a list of workflows bound to selected portal_type, this workflow
list may contain both DC Workflow and Workflow.
"""
"""
portal_type
=
self
.
getPortalObject
().
getDefaultModule
(
portal_type
=
"portal_types"
).
_getOb
(
portal_type_id
,
None
)
portal_type
=
self
.
getPortalObject
().
getDefaultModule
(
portal_type
=
"portal_types"
).
_getOb
(
portal_type_id
,
None
)
workflow_list
=
[]
workflow_list
=
[]
if
portal_type
is
not
None
:
if
portal_type
is
not
None
:
# checking Workflow assignment:
for
workflow_id
in
portal_type
.
getTypeWorkflowList
():
for
workflow_id
in
portal_type
.
getTypeWorkflowList
():
workflow_list
.
append
(
self
.
_getOb
(
workflow_id
))
workflow_list
.
append
(
self
.
_getOb
(
workflow_id
))
for
wf
in
self
.
getWorkflowsFor
(
portal_type_id
):
for
wf
in
self
.
getWorkflowsFor
(
portal_type_id
):
# checking DC Workflow assignment
if
wf
is
not
None
:
if
wf
is
not
None
:
workflow_list
.
append
(
wf
)
workflow_list
.
append
(
wf
)
return
workflow_list
return
workflow_list
...
@@ -696,19 +699,27 @@ class WorkflowTool(BaseTool, OriginalWorkflowTool):
...
@@ -696,19 +699,27 @@ class WorkflowTool(BaseTool, OriginalWorkflowTool):
document_pt
=
document
.
getTypeInfo
()
document_pt
=
document
.
getTypeInfo
()
if
document_pt
is
not
None
:
if
document_pt
is
not
None
:
workflow_list
=
self
.
getWorkflowValueListFor
(
document
.
getPortalType
())
workflow_list
=
self
.
getWorkflowValueListFor
(
document
.
getPortalType
())
if
(
workflow_list
is
not
None
)
and
(
workflow_list
is
not
[]):
for
wf
in
workflow_list
:
for
wf
in
workflow_list
:
wf_id
=
wf
.
getReference
()
wf_id
=
wf
.
getReference
()
did
[
wf_id
]
=
None
did
[
wf_id
]
=
None
wf
=
self
.
getPortalObject
().
portal_workflow
.
_getOb
(
wf_id
,
None
)
wf
=
self
.
getPortalObject
().
portal_workflow
.
_getOb
(
wf_id
,
None
)
if
wf
is
None
:
if
wf
is
None
:
raise
NotImplementedError
(
"Can not find workflow: %s, please check if the workflow exists."
%
wf_id
)
raise
NotImplementedError
(
"Can not find workflow: %s, please check if the workflow exists."
%
wf_id
)
a
=
wf
.
listObjectActions
(
info
)
a
=
wf
.
listObjectActions
(
info
)
if
a
is
not
None
and
a
!=
[]:
if
a
is
not
None
and
a
!=
[]:
actions
.
extend
(
a
)
actions
.
extend
(
a
)
a
=
wf
.
getWorklistVariableMatchDict
(
info
)
a
=
wf
.
getWorklistVariableMatchDict
(
info
)
if
a
is
not
None
:
if
a
is
not
None
:
worklist_dict
[
wf_id
]
=
a
worklist_dict
[
wf_id
]
=
a
wf_ids
=
self
.
getWorkflowIds
()
for
wf_id
in
wf_ids
:
if
not
did
.
has_key
(
wf_id
):
wf
=
self
.
getWorkflowById
(
wf_id
)
if
wf
is
not
None
:
a
=
wf
.
getWorklistVariableMatchDict
(
info
)
if
a
is
not
None
:
worklist_dict
[
wf_id
]
=
a
if
worklist_dict
:
if
worklist_dict
:
portal
=
self
.
getPortalObject
()
portal
=
self
.
getPortalObject
()
...
...
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