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
Eteri
erp5
Commits
fae6805f
Commit
fae6805f
authored
Aug 04, 2015
by
wenjie.zheng
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Workflow.py: fix getCatalogVariablesFor not returning initial_state correctly error.
parent
a860e63f
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
9 deletions
+7
-9
product/ERP5Workflow/Document/Workflow.py
product/ERP5Workflow/Document/Workflow.py
+7
-9
No files found.
product/ERP5Workflow/Document/Workflow.py
View file @
fae6805f
...
@@ -1075,7 +1075,10 @@ class Workflow(IdAsReferenceMixin("", "prefix"), XMLObject):
...
@@ -1075,7 +1075,10 @@ class Workflow(IdAsReferenceMixin("", "prefix"), XMLObject):
Returns a mapping containing the catalog variables
Returns a mapping containing the catalog variables
that apply to ob.
that apply to ob.
'''
'''
initial_state
=
None
res
=
{}
res
=
{}
# Always provide the state variable.
state_var
=
self
.
getStateVariable
()
status
=
self
.
getCurrentStatusDict
(
ob
)
status
=
self
.
getCurrentStatusDict
(
ob
)
for
id
,
vdef
in
self
.
getVariableValueList
().
iteritems
():
for
id
,
vdef
in
self
.
getVariableValueList
().
iteritems
():
if
vdef
.
for_catalog
:
if
vdef
.
for_catalog
:
...
@@ -1088,17 +1091,12 @@ class Workflow(IdAsReferenceMixin("", "prefix"), XMLObject):
...
@@ -1088,17 +1091,12 @@ class Workflow(IdAsReferenceMixin("", "prefix"), XMLObject):
value
=
vdef
.
default_expr
(
ec
)
value
=
vdef
.
default_expr
(
ec
)
else
:
else
:
value
=
vdef
.
default_value
value
=
vdef
.
default_value
res
[
id
]
=
value
res
[
id
]
=
value
# Always provide the state variable.
if
hasattr
(
self
,
'getSourceValue'
):
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
:
if
self
.
getSourceValue
()
is
not
None
:
res
[
state_var
]
=
self
.
getSourceValue
().
getReference
()
initial_state
=
self
.
getSourceValue
().
getReference
()
els
e
:
if
state_var
is
not
Non
e
:
res
[
state_var
]
=
None
res
[
state_var
]
=
status
.
get
(
state_var
,
initial_state
)
return
res
return
res
def
Guard_checkWithoutRoles
(
self
,
sm
,
wf_def
,
ob
,
**
kw
):
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