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
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Papa Tamsir Kane
erp5
Commits
4d9fb621
Commit
4d9fb621
authored
May 04, 2015
by
wenjie.zheng
Committed by
Sebastien Robin
Jul 16, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Transition.py: replace split with delicate methods.
parent
933e2212
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
10 deletions
+8
-10
product/ERP5Workflow/Document/Transition.py
product/ERP5Workflow/Document/Transition.py
+8
-10
No files found.
product/ERP5Workflow/Document/Transition.py
View file @
4d9fb621
...
...
@@ -144,10 +144,13 @@ class Transition(IdAsReferenceMixin("transition_", "prefix"), XMLObject):
if
state_object
==
None
:
state_object
=
workflow
.
getSourceValue
()
old_state
=
state_object
.
get
Id
()
old_state
=
state_object
.
get
Reference
()
old_sdef
=
state_object
new_state
=
self
.
getDestinationId
()
new_sdef
=
self
.
getDestinationValue
()
if
new_sdef
==
None
:
new_state
=
None
else
:
new_state
=
new_sdef
.
getReference
()
if
new_state
is
None
:
#new_state = workflow.getSourceId()
...
...
@@ -160,11 +163,6 @@ class Transition(IdAsReferenceMixin("transition_", "prefix"), XMLObject):
else
:
former_status
=
state_object
.
getId
()
try
:
new_sdef
=
self
.
getDestinationValue
()
except
KeyError
:
raise
WorkflowException
(
'Destination state undefined: '
+
new_state
)
LOG
(
" 168 object '%s' will change from state '%s' to '%s'"
%
(
document
.
getId
(),
old_state
,
new_state
),
WARNING
,
" in Transition.py"
)
# Execute the "before" script.
...
...
@@ -210,7 +208,7 @@ class Transition(IdAsReferenceMixin("transition_", "prefix"), XMLObject):
status_dict
[
'undo'
]
=
0
# Modify workflow history
status_dict
[
state_var
]
=
'_'
.
join
(
new_state
.
split
(
'_'
)[
1
:])
status_dict
[
state_var
]
=
new_state
object
=
workflow
.
getStateChangeInformation
(
document
,
state_object
,
transition
=
self
)
# update variables =========================================================
...
...
@@ -227,7 +225,7 @@ class Transition(IdAsReferenceMixin("transition_", "prefix"), XMLObject):
for
vdef
in
workflow
.
objectValues
(
portal_type
=
'Variable'
):
id
=
vdef
.
getId
()
id_no_suffix
=
'_'
.
join
(
id
.
split
(
'_'
)[
1
:]
)
id_no_suffix
=
vdef
.
getReference
(
)
if
vdef
.
for_status
==
0
:
continue
expr
=
None
...
...
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