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
b718bacc
Commit
b718bacc
authored
Jul 15, 2015
by
wenjie.zheng
Committed by
Sebastien Robin
Jul 16, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
WorkflowTool.py: deal with multiple scripts defined in interaction in conversion.
parent
67e40bd1
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
9 deletions
+19
-9
product/ERP5/Tool/WorkflowTool.py
product/ERP5/Tool/WorkflowTool.py
+19
-9
No files found.
product/ERP5/Tool/WorkflowTool.py
View file @
b718bacc
...
...
@@ -431,32 +431,42 @@ class WorkflowTool(BaseTool, OriginalWorkflowTool):
tdef
=
dc_workflow
.
interactions
.
get
(
tid
)
interaction
.
setTitle
(
tdef
.
title
)
interaction
.
setReference
(
tdef
.
id
)
script_list
=
[]
for
script_name
in
tdef
.
activate_script_name
:
if
script_name
in
dc_workflow
.
interactions
.
objectIds
():
interaction
.
setActivateScriptName
((
'interaction_'
+
script_name
,)
)
script_list
.
append
(
'interaction_'
+
script_name
)
elif
script_name
in
dc_workflow
.
scripts
.
objectIds
():
interaction
.
setActivateScriptName
((
'script_'
+
script_name
,))
script_list
.
append
(
'script_'
+
script_name
)
interaction
.
setActivateScriptNameList
(
tuple
(
script_list
))
script_list
=
[]
for
script_name
in
tdef
.
after_script_name
:
if
script_name
in
dc_workflow
.
interactions
.
objectIds
():
interaction
.
setAfterScriptName
((
'interaction_'
+
script_name
,)
)
script_list
.
append
(
'interaction_'
+
script_name
)
elif
script_name
in
dc_workflow
.
scripts
.
objectIds
():
interaction
.
setAfterScriptName
((
'script_'
+
script_name
,))
script_list
.
append
(
'script_'
+
script_name
)
interaction
.
setAfterScriptNameList
(
tuple
(
script_list
))
script_list
=
[]
for
script_name
in
tdef
.
before_commit_script_name
:
if
script_name
in
dc_workflow
.
interactions
.
objectIds
():
interaction
.
setBeforeCommitScriptName
((
'interaction_'
+
script_name
,)
)
script_list
.
append
(
'interaction_'
+
script_name
)
elif
script_name
in
dc_workflow
.
scripts
.
objectIds
():
interaction
.
setBeforeCommitScriptName
((
'script_'
+
script_name
,))
script_list
.
append
(
'script_'
+
script_name
)
interaction
.
setBeforeCommitScriptNameList
(
tuple
(
script_list
))
script_list
=
[]
for
script_name
in
tdef
.
script_name
:
if
script_name
in
dc_workflow
.
interactions
.
objectIds
():
interaction
.
setBeforeScriptName
((
'interaction_'
+
script_name
,)
)
script_list
.
append
(
'interaction_'
+
script_name
)
elif
script_name
in
dc_workflow
.
scripts
.
objectIds
():
interaction
.
setBeforeScriptName
((
'script_'
+
script_name
,))
script_list
.
append
(
'script_'
+
script_name
)
interaction
.
setBeforeScriptNameList
(
tuple
(
script_list
))
# configure guard
if
tdef
.
guard
:
interaction
.
setRoleList
(
tdef
.
guard
.
roles
)
interaction
.
setPermissionList
(
tdef
.
guard
.
permissions
)
interaction
.
setGroupList
(
tdef
.
guard
.
groups
)
interaction
.
setExpression
(
tdef
.
guard
.
expr
)
if
tdef
.
guard
.
expr
is
not
None
:
interaction
.
setExpression
(
tdef
.
guard
.
expr
.
text
)
else
:
interaction
.
setExpression
(
''
)
interaction
.
setPortalTypeFilter
(
tdef
.
portal_type_filter
)
interaction
.
setPortalTypeGroupFilter
(
tdef
.
portal_type_group_filter
)
...
...
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