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
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Hamza
erp5
Commits
f40882c3
Commit
f40882c3
authored
Jul 27, 2015
by
wenjie.zheng
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Workflow.py: modify getCatalogVariablesFor to fit workflow compatibility.
parent
d24e76bc
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
6 deletions
+11
-6
product/ERP5Workflow/Document/Workflow.py
product/ERP5Workflow/Document/Workflow.py
+11
-6
No files found.
product/ERP5Workflow/Document/Workflow.py
View file @
f40882c3
...
...
@@ -1004,7 +1004,7 @@ class Workflow(IdAsReferenceMixin("", "prefix"), XMLObject):
if
old_state
==
new_state_id
:
# Object is already in expected state
return
former_status
=
self
.
_getStatusOf
(
ob
)
former_status
=
self
.
getCurrentStatusDict
(
ob
)
new_sdef
=
self
.
_getOb
(
new_state_id
,
None
)
if
new_sdef
is
None
:
...
...
@@ -1065,7 +1065,6 @@ class Workflow(IdAsReferenceMixin("", "prefix"), XMLObject):
"""
return
1
security
.
declarePrivate
(
'getCatalogVariablesFor'
)
def
getCatalogVariablesFor
(
self
,
ob
):
'''
Allows this workflow to make workflow-specific variables
...
...
@@ -1075,8 +1074,8 @@ class Workflow(IdAsReferenceMixin("", "prefix"), XMLObject):
that apply to ob.
'''
res
=
{}
status
=
self
.
_getStatusOf
(
ob
)
for
id
,
vdef
in
self
.
getVariableValueList
():
status
=
self
.
getCurrentStatusDict
(
ob
)
for
id
,
vdef
in
self
.
getVariableValueList
()
.
iteritems
()
:
if
vdef
.
for_catalog
:
if
status
.
has_key
(
id
):
value
=
status
[
id
]
...
...
@@ -1090,8 +1089,14 @@ class Workflow(IdAsReferenceMixin("", "prefix"), XMLObject):
res
[
id
]
=
value
# Always provide the state variable.
state_var
=
self
.
state_var
res
[
state_var
]
=
status
.
get
(
state_var
,
self
.
initial_state
)
state_var
=
self
.
getStateVariable
()
if
state_var
is
not
None
:
res
[
state_var
]
=
status
[
state_var
]
elif
hasattr
(
self
,
'getSourceValue'
):
if
self
.
getSourceValue
()
is
not
None
:
res
[
state_var
]
=
self
.
getSourceValue
().
getReference
()
else
:
res
[
state_var
]
=
None
return
res
def
Guard_checkWithoutRoles
(
self
,
sm
,
wf_def
,
ob
,
**
kw
):
...
...
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