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
Laurent S
erp5
Commits
04c1c4cf
Commit
04c1c4cf
authored
May 03, 2015
by
wenjie.zheng
Committed by
Sebastien Robin
Jul 16, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ERP5WorkflowTool.py: fix the compatibility, add LOGs and remove unused comments.
parent
0905b814
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
10 deletions
+12
-10
product/ERP5/Tool/ERP5WorkflowTool.py
product/ERP5/Tool/ERP5WorkflowTool.py
+12
-10
No files found.
product/ERP5/Tool/ERP5WorkflowTool.py
View file @
04c1c4cf
...
...
@@ -166,11 +166,11 @@ class ERP5WorkflowTool(BaseTool, OriginalWorkflowTool):
return
True
return
False
def
_
doActionFor
(
self
,
ob
,
action
,
wf_id
=
None
,
*
args
,
**
kw
):
wfs
=
self
.
getWorkflowsFor
(
ob
)
workflow_list
=
ob
.
getTypeInfo
().
getTypeERP5WorkflowList
()
def
doActionFor
(
self
,
ob
,
action
,
wf_id
=
None
,
*
args
,
**
kw
):
wfs
=
self
.
getWorkflowsFor
(
ob
)
# dc workflow
workflow_list
=
ob
.
getTypeInfo
().
getTypeERP5WorkflowList
()
# workflow
case
=
1
LOG
(
" 173 do action '%s' for object '%s'"
%
(
action
,
ob
.
getId
()),
WARNING
,
" in ERP5 Workflow Tool.py"
)
if
wfs
is
None
or
wf_id
in
workflow_list
:
wfs
=
()
case
=
2
...
...
@@ -185,7 +185,7 @@ class ERP5WorkflowTool(BaseTool, OriginalWorkflowTool):
case
=
1
break
for
workflow_id
in
workflow_list
:
wf
=
self
.
getPortalObject
().
portal_workflow
.
_getOb
(
workflow_id
)
### _getObjectByRef
wf
=
self
.
getPortalObject
().
portal_workflow
.
_getOb
(
workflow_id
)
if
wf
.
isActionSupported
(
ob
,
action
,
**
kw
):
found
=
1
case
=
2
...
...
@@ -198,7 +198,7 @@ class ERP5WorkflowTool(BaseTool, OriginalWorkflowTool):
if
case
==
1
:
wf
=
self
.
getWorkflowById
(
wf_id
)
else
:
wf
=
self
.
getPortalObject
().
portal_workflow
.
_getOb
(
wf_id
,
None
)
### _getObjectByRef
wf
=
self
.
getPortalObject
().
portal_workflow
.
_getOb
(
wf_id
,
None
)
if
wf
is
None
:
raise
WorkflowException
(
_
(
u'Requested workflow definition not found.'
))
...
...
@@ -227,7 +227,7 @@ class ERP5WorkflowTool(BaseTool, OriginalWorkflowTool):
case
=
1
break
for
workflow_id
in
workflow_list
:
workflow
=
self
.
getPortalObject
().
portal_workflow
.
_getOb
(
workflow_id
)
### _getObjectByRef
workflow
=
self
.
getPortalObject
().
portal_workflow
.
_getOb
(
workflow_id
)
if
workflow
.
isInfoSuported
(
ob
,
name
):
found
=
1
case
=
2
...
...
@@ -243,7 +243,7 @@ class ERP5WorkflowTool(BaseTool, OriginalWorkflowTool):
if
case
==
1
:
wf
=
self
.
getWorkflowById
(
wf_id
)
else
:
wf
=
self
.
getPortalObject
().
portal_workflow
.
_getOb
(
wf_id
)
### _getObjectByRef
wf
=
self
.
getPortalObject
().
portal_workflow
.
_getOb
(
wf_id
)
if
wf
is
None
:
if
default
is
_marker
:
raise
WorkflowException
(
...
...
@@ -612,16 +612,18 @@ class ERP5WorkflowTool(BaseTool, OriginalWorkflowTool):
if
(
workflow_list
is
not
None
)
and
(
workflow_list
is
not
[]):
for
wf_id
in
workflow_list
:
did
[
wf_id
]
=
None
wf
=
self
.
getPortalObject
().
portal_workflow
.
_getOb
(
wf_id
,
None
)
### getObjectByRef
wf
=
self
.
getPortalObject
().
portal_workflow
.
_getOb
(
wf_id
,
None
)
if
wf
is
None
:
raise
NotImplementedError
(
"Can not find workflow: %s, please check if the workflow exists."
%
wf_id
)
a
=
wf
.
listObjectActions
(
info
)
if
a
is
not
None
:
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
)
a
=
wf
.
getWorklistVariableMatchDict
(
info
)
if
a
is
not
None
:
worklist_dict
[
wf_id
]
=
a
# DC workflow compatibility
for
wf_id
in
chain
:
did
[
wf_id
]
=
None
wf
=
self
.
getWorkflowById
(
wf_id
)
...
...
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