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
ed25a9bf
Commit
ed25a9bf
authored
Aug 26, 2016
by
iv
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ERP5Workflow: add 'script_' prefix in the script's id when converting it
parent
45794c3c
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
6 deletions
+6
-6
product/ERP5Workflow/Document/WorkflowScript.py
product/ERP5Workflow/Document/WorkflowScript.py
+1
-1
product/ERP5Workflow/Tool/WorkflowTool.py
product/ERP5Workflow/Tool/WorkflowTool.py
+5
-5
No files found.
product/ERP5Workflow/Document/WorkflowScript.py
View file @
ed25a9bf
...
...
@@ -35,7 +35,7 @@ from Products.ERP5Type import Permissions, PropertySheet
from
Products.ERP5Type.ConsistencyMessage
import
ConsistencyMessage
from
Products.ERP5Type.id_as_reference
import
IdAsReferenceMixin
class
WorkflowScript
(
PythonScript
,
IdAsReferenceMixin
(
""
,
"prefix"
)):
class
WorkflowScript
(
PythonScript
,
IdAsReferenceMixin
(
"
script_
"
,
"prefix"
)):
meta_type
=
'ERP5 Python Script'
portal_type
=
'Workflow Script'
add_permission
=
Permissions
.
AddPortalContent
...
...
product/ERP5Workflow/Tool/WorkflowTool.py
View file @
ed25a9bf
...
...
@@ -263,7 +263,8 @@ class WorkflowTool(BaseTool, OriginalWorkflowTool):
initial_script_name_list
=
[
initial_script_name_list
]
for
script_name
in
initial_script_name_list
:
if
script_name
:
script
=
getattr
(
workflow
,
'ScriptPrefix_'
+
script_name
,
None
)
or
getattr
(
workflow
,
script_name
,
None
)
or
getattr
(
workflow
,
'transition_'
+
script_name
,
None
)
script
=
getattr
(
workflow
,
'script_'
+
script_name
,
None
)
or
\
getattr
(
workflow
,
'transition_'
+
script_name
,
None
)
script_path
=
script
.
getRelativeUrl
()
script_path_list
.
append
(
script_path
)
method
(
tuple
(
script_path_list
))
...
...
@@ -303,10 +304,9 @@ class WorkflowTool(BaseTool, OriginalWorkflowTool):
for
script_id
in
dc_workflow_script_list
:
script
=
dc_workflow_script_list
.
get
(
script_id
)
# add a prefix if there is a script & method conflict
if
hasattr
(
workflow
,
script_id
):
workflow_script
=
workflow
.
newContent
(
id
=
'ScriptPrefix_'
+
script_id
,
portal_type
=
'Workflow Script'
,
temp_object
=
is_temporary
)
else
:
workflow_script
=
workflow
.
newContent
(
id
=
script_id
,
portal_type
=
'Workflow Script'
,
temp_object
=
is_temporary
)
workflow_script
=
workflow
.
newContent
(
id
=
'script_'
+
script_id
,
portal_type
=
'Workflow Script'
,
temp_object
=
is_temporary
)
workflow_script
.
setTitle
(
script
.
title
)
workflow_script
.
default_reference
=
script_id
workflow_script
.
setParameterSignature
(
script
.
_params
)
...
...
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