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
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Sebastien Robin
erp5
Commits
65c6fe60
Commit
65c6fe60
authored
Oct 11, 2016
by
iv
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ERP5Workflow: fix doActionFor method
parent
5b174fa5
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
14 deletions
+17
-14
product/ERP5Workflow/Tool/WorkflowTool.py
product/ERP5Workflow/Tool/WorkflowTool.py
+17
-14
No files found.
product/ERP5Workflow/Tool/WorkflowTool.py
View file @
65c6fe60
...
...
@@ -189,29 +189,32 @@ class WorkflowTool(BaseTool, OriginalWorkflowTool):
self
.
manage_renameObjects
(
ids
=
[
pasted_workflow_id
,],
new_ids
=
[
new_workflow_id
,])
def
doActionFor
(
self
,
ob
,
action
,
wf_id
=
None
,
*
args
,
**
kw
):
workflow_list
=
self
.
getWorkflowsFor
(
ob
.
getPortalType
())
if
wf_id
is
None
:
def
doActionFor
(
self
,
current_object
,
action_reference
,
workflow_id
=
None
,
*
args
,
**
kw
):
workflow_list
=
self
.
getWorkflowsFor
(
current_object
.
getPortalType
())
action_id
=
action_reference
if
workflow_id
is
None
:
if
workflow_list
==
[]:
raise
WorkflowException
(
_
(
u'No workflows found.'
))
found
=
0
for
w
f
in
workflow_list
:
if
w
f
.
getPortalType
()
==
'Workflow'
:
action
=
'transition_'
+
action
if
w
f
.
isActionSupported
(
ob
,
action
,
**
kw
):
for
w
orkflow
in
workflow_list
:
if
w
orkflow
.
getPortalType
()
==
'Workflow'
:
action
_id
=
'transition_'
+
action_reference
if
w
orkflow
.
isActionSupported
(
current_object
,
action_id
,
**
kw
):
found
=
1
break
if
not
found
:
m
sg
=
_
(
u"No workflow provides the '${action_id}' action."
,
mapping
=
{
'action_id'
:
action
})
raise
WorkflowException
(
m
sg
)
m
essage
=
"No workflow provides the %s action."
%
action_id
raise
WorkflowException
(
m
essage
)
else
:
w
f
=
self
.
getWorkflowById
(
wf
_id
)
if
w
f
is
None
:
w
orkflow
=
self
.
getWorkflowById
(
workflow
_id
)
if
w
orkflow
is
None
:
raise
WorkflowException
(
_
(
u'Requested workflow definition not found.'
))
if
w
f
.
getPortalType
()
==
'Workflow'
:
action
=
'transition_'
+
action
if
w
orkflow
.
getPortalType
()
==
'Workflow'
:
action
_id
=
'transition_'
+
action_reference
result
=
self
.
_invokeWithNotification
(
workflow_list
,
ob
,
action
,
wf
.
doActionFor
,
(
ob
,
action
)
+
args
,
kw
)
workflow_list
,
current_object
,
action_id
,
workflow
.
doActionFor
,
(
current_object
,
action_id
)
+
args
,
kw
)
return
result
security
.
declareProtected
(
Permissions
.
AccessContentsInformation
,
...
...
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