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
iv
erp5
Commits
c4ade4da
Commit
c4ade4da
authored
Aug 29, 2016
by
iv
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ERP5Workflow: fix setting after scripts when converting workflow
parent
ed25a9bf
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
24 additions
and
14 deletions
+24
-14
product/ERP5Workflow/Tool/WorkflowTool.py
product/ERP5Workflow/Tool/WorkflowTool.py
+24
-14
No files found.
product/ERP5Workflow/Tool/WorkflowTool.py
View file @
c4ade4da
...
@@ -257,7 +257,7 @@ class WorkflowTool(BaseTool, OriginalWorkflowTool):
...
@@ -257,7 +257,7 @@ class WorkflowTool(BaseTool, OriginalWorkflowTool):
temp_workflow_id_list
.
append
(
temp_workflow
.
getTitle
())
temp_workflow_id_list
.
append
(
temp_workflow
.
getTitle
())
return
temp_workflow_list
return
temp_workflow_list
def
initialize_script_categories
(
self
,
workflow
,
initial_script_name_list
,
method
):
def
getScriptPathList
(
self
,
workflow
,
initial_script_name_list
):
script_path_list
=
[]
script_path_list
=
[]
if
isinstance
(
initial_script_name_list
,
str
):
if
isinstance
(
initial_script_name_list
,
str
):
initial_script_name_list
=
[
initial_script_name_list
]
initial_script_name_list
=
[
initial_script_name_list
]
...
@@ -267,7 +267,7 @@ class WorkflowTool(BaseTool, OriginalWorkflowTool):
...
@@ -267,7 +267,7 @@ class WorkflowTool(BaseTool, OriginalWorkflowTool):
getattr
(
workflow
,
'transition_'
+
script_name
,
None
)
getattr
(
workflow
,
'transition_'
+
script_name
,
None
)
script_path
=
script
.
getRelativeUrl
()
script_path
=
script
.
getRelativeUrl
()
script_path_list
.
append
(
script_path
)
script_path_list
.
append
(
script_path
)
method
(
tuple
(
script_path_list
))
return
script_path_list
def
dc_workflow_asERP5Object
(
self
,
dc_workflow
,
is_temporary
=
False
):
def
dc_workflow_asERP5Object
(
self
,
dc_workflow
,
is_temporary
=
False
):
""" convert DC Workflow to New Workflow """
""" convert DC Workflow to New Workflow """
...
@@ -351,11 +351,14 @@ class WorkflowTool(BaseTool, OriginalWorkflowTool):
...
@@ -351,11 +351,14 @@ class WorkflowTool(BaseTool, OriginalWorkflowTool):
# we have to loop again over transitions because some
# we have to loop again over transitions because some
# before/after/... scripts are transitions and obviously, all of
# before/after/... scripts are transitions and obviously, all of
# them were not defined on the new workflow in the previous loop
# them were not defined on the new workflow in the previous loop
old_transition
=
dc_workflow_transition_value_list
.
get
(
transition
.
getReference
())
script_path_list
=
self
.
getScriptPathList
(
workflow
,
old_transition
.
script_name
)
transition
.
setBeforeScriptValueList
(
script_path_list
)
self
.
initialize_script_categories
(
workflow
,
tdef
.
script_name
,
script_path_list
=
self
.
getScriptPathList
(
workflow
,
transition
.
setBeforeScriptValueList
)
old_transition
.
after_script_name
)
self
.
initialize_script_categories
(
workflow
,
tdef
.
after_script_name
,
transition
.
setAfterScriptValueList
(
script_path_list
)
transition
.
setAfterScriptValueList
)
# create states (portal_type = State)
# create states (portal_type = State)
for
sid
in
dc_workflow
.
states
:
for
sid
in
dc_workflow
.
states
:
...
@@ -461,14 +464,21 @@ class WorkflowTool(BaseTool, OriginalWorkflowTool):
...
@@ -461,14 +464,21 @@ class WorkflowTool(BaseTool, OriginalWorkflowTool):
# configure after/before/before commit/activate scripts
# configure after/before/before commit/activate scripts
# no need to loop again over interactions as made for transitions
# no need to loop again over interactions as made for transitions
# because interactions xxx_script are not interactions
# because interactions xxx_script are not interactions
self
.
initialize_script_categories
(
workflow
,
tdef
.
script_name
,
script_path_list
=
self
.
getScriptPathList
(
workflow
,
interaction
.
setBeforeScriptValueList
)
tdef
.
script_name
)
self
.
initialize_script_categories
(
workflow
,
tdef
.
after_script_name
,
interaction
.
setBeforeScriptValueList
(
script_path_list
)
interaction
.
setAfterScriptValueList
)
self
.
initialize_script_categories
(
workflow
,
tdef
.
activate_script_name
,
script_path_list
=
self
.
getScriptPathList
(
workflow
,
interaction
.
setActivateScriptValueList
)
tdef
.
after_script_name
)
self
.
initialize_script_categories
(
workflow
,
tdef
.
before_commit_script_name
,
interaction
.
setAfterScriptValueList
(
script_path_list
)
interaction
.
setBeforeCommitScriptValueList
)
script_path_list
=
self
.
getScriptPathList
(
workflow
,
tdef
.
activate_script_name
)
interaction
.
setActivateScriptValueList
(
script_path_list
)
script_path_list
=
self
.
getScriptPathList
(
workflow
,
tdef
.
before_commit_script_name
)
interaction
.
setBeforeCommitScriptValueList
(
script_path_list
)
# configure guard
# configure guard
if
tdef
.
guard
:
if
tdef
.
guard
:
...
...
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