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
preetwinder
erp5
Commits
c5005310
Commit
c5005310
authored
Dec 17, 2014
by
wenjie.zheng
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Workflow: Avoid lstrip in isERP5WorkflowMethodSupported.
parent
7cdf2dec
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 addition
and
12 deletions
+1
-12
product/ERP5Workflow/Document/Workflow.py
product/ERP5Workflow/Document/Workflow.py
+1
-12
No files found.
product/ERP5Workflow/Document/Workflow.py
View file @
c5005310
...
...
@@ -141,24 +141,13 @@ class Workflow(XMLObject):
state
=
state
)
def
isERP5WorkflowMethodSupported
(
self
,
document
,
transition
):
sdef
=
self
.
_getERP5WorkflowStateOf
(
document
)
sdef
=
document
.
_getDefaultAcquiredValue
(
self
.
getStateBaseCategory
()
)
if
sdef
is
None
:
return
0
if
transition
in
sdef
.
getDestinationValueList
():
return
1
return
0
def
_getERP5WorkflowStateOf
(
self
,
ob
):
bc_id
=
self
.
getStateBaseCategory
()
state_path
=
ob
.
getCategoryList
()
### should avoid using lstrip
state_path
=
state_path
[
0
].
lstrip
(
"%s/"
%
bc_id
)
if
state_path
is
not
None
:
sdef
=
self
.
restrictedTraverse
(
state_path
)
else
:
sdef
=
None
return
sdef
###########
## Graph ##
############
...
...
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