Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
E
erp5_workflow
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
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wenjie.zheng
erp5_workflow
Commits
454bcceb
Commit
454bcceb
authored
May 06, 2015
by
wenjie.zheng
Committed by
Sebastien Robin
Jul 16, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ERP5WorkflowTool.py: clean the code, modification on universal methods.
parent
3411caf1
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 addition
and
9 deletions
+1
-9
product/ERP5/Tool/ERP5WorkflowTool.py
product/ERP5/Tool/ERP5WorkflowTool.py
+1
-9
No files found.
product/ERP5/Tool/ERP5WorkflowTool.py
View file @
454bcceb
...
@@ -178,7 +178,6 @@ class ERP5WorkflowTool(BaseTool, OriginalWorkflowTool):
...
@@ -178,7 +178,6 @@ class ERP5WorkflowTool(BaseTool, OriginalWorkflowTool):
for
wf
in
workflow_list
:
for
wf
in
workflow_list
:
if
wf
.
isActionSupported
(
ob
,
action
,
**
kw
):
if
wf
.
isActionSupported
(
ob
,
action
,
**
kw
):
found
=
1
found
=
1
case
=
2
break
break
if
not
found
:
if
not
found
:
msg
=
_
(
u"No workflow provides the '${action_id}' action."
,
mapping
=
{
'action_id'
:
action
})
msg
=
_
(
u"No workflow provides the '${action_id}' action."
,
mapping
=
{
'action_id'
:
action
})
...
@@ -192,6 +191,7 @@ class ERP5WorkflowTool(BaseTool, OriginalWorkflowTool):
...
@@ -192,6 +191,7 @@ class ERP5WorkflowTool(BaseTool, OriginalWorkflowTool):
def
_getInfoFor
(
self
,
ob
,
name
,
default
=
_marker
,
wf_id
=
None
,
*
args
,
**
kw
):
def
_getInfoFor
(
self
,
ob
,
name
,
default
=
_marker
,
wf_id
=
None
,
*
args
,
**
kw
):
workflow_list
=
self
.
getWorkflowValueListFor
(
ob
.
getPortalType
())
workflow_list
=
self
.
getWorkflowValueListFor
(
ob
.
getPortalType
())
if
wf_id
is
None
:
if
wf_id
is
None
:
if
workflow_list
==
[]:
if
workflow_list
==
[]:
if
default
is
_marker
:
if
default
is
_marker
:
...
@@ -202,7 +202,6 @@ class ERP5WorkflowTool(BaseTool, OriginalWorkflowTool):
...
@@ -202,7 +202,6 @@ class ERP5WorkflowTool(BaseTool, OriginalWorkflowTool):
for
workflow
in
workflow_list
:
for
workflow
in
workflow_list
:
if
workflow
.
isInfoSuported
(
ob
,
name
):
if
workflow
.
isInfoSuported
(
ob
,
name
):
found
=
1
found
=
1
case
=
2
break
break
if
not
found
:
if
not
found
:
if
default
is
_marker
:
if
default
is
_marker
:
...
@@ -394,11 +393,6 @@ class ERP5WorkflowTool(BaseTool, OriginalWorkflowTool):
...
@@ -394,11 +393,6 @@ class ERP5WorkflowTool(BaseTool, OriginalWorkflowTool):
"""Test if the given transition exist from the current state.
"""Test if the given transition exist from the current state.
"""
"""
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
())):
state
=
workflow
.
_getWorkflowStateOf
(
ob
)
if
state
and
transition_id
in
state
.
transitions
:
return
1
for
workflow_id
in
ob
.
getTypeInfo
().
getTypeERP5WorkflowList
():
workflow
=
self
.
getPortalObject
().
portal_workflow
.
_getOb
(
workflow_id
)
state
=
workflow
.
_getWorkflowStateOf
(
ob
)
state
=
workflow
.
_getWorkflowStateOf
(
ob
)
if
state
and
transition_id
in
state
.
getDestinationIdList
():
if
state
and
transition_id
in
state
.
getDestinationIdList
():
return
1
return
1
...
@@ -568,12 +562,10 @@ class ERP5WorkflowTool(BaseTool, OriginalWorkflowTool):
...
@@ -568,12 +562,10 @@ class ERP5WorkflowTool(BaseTool, OriginalWorkflowTool):
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
!=
[]:
LOG
(
"620 Generating workflow actions '%s' for workflow '%s'"
%
(
a
,
wf_id
),
WARNING
,
" in ERP5WorkflowTool.py"
)
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
# DC workflow compatibility
# DC workflow compatibility
for
wf_id
in
chain
:
for
wf_id
in
chain
:
did
[
wf_id
]
=
None
did
[
wf_id
]
=
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