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
Matevz Golob
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):
...
@@ -1004,7 +1004,7 @@ class Workflow(IdAsReferenceMixin("", "prefix"), XMLObject):
if
old_state
==
new_state_id
:
if
old_state
==
new_state_id
:
# Object is already in expected state
# Object is already in expected state
return
return
former_status
=
self
.
_getStatusOf
(
ob
)
former_status
=
self
.
getCurrentStatusDict
(
ob
)
new_sdef
=
self
.
_getOb
(
new_state_id
,
None
)
new_sdef
=
self
.
_getOb
(
new_state_id
,
None
)
if
new_sdef
is
None
:
if
new_sdef
is
None
:
...
@@ -1065,7 +1065,6 @@ class Workflow(IdAsReferenceMixin("", "prefix"), XMLObject):
...
@@ -1065,7 +1065,6 @@ class Workflow(IdAsReferenceMixin("", "prefix"), XMLObject):
"""
"""
return
1
return
1
security
.
declarePrivate
(
'getCatalogVariablesFor'
)
def
getCatalogVariablesFor
(
self
,
ob
):
def
getCatalogVariablesFor
(
self
,
ob
):
'''
'''
Allows this workflow to make workflow-specific variables
Allows this workflow to make workflow-specific variables
...
@@ -1075,8 +1074,8 @@ class Workflow(IdAsReferenceMixin("", "prefix"), XMLObject):
...
@@ -1075,8 +1074,8 @@ class Workflow(IdAsReferenceMixin("", "prefix"), XMLObject):
that apply to ob.
that apply to ob.
'''
'''
res
=
{}
res
=
{}
status
=
self
.
_getStatusOf
(
ob
)
status
=
self
.
getCurrentStatusDict
(
ob
)
for
id
,
vdef
in
self
.
getVariableValueList
():
for
id
,
vdef
in
self
.
getVariableValueList
()
.
iteritems
()
:
if
vdef
.
for_catalog
:
if
vdef
.
for_catalog
:
if
status
.
has_key
(
id
):
if
status
.
has_key
(
id
):
value
=
status
[
id
]
value
=
status
[
id
]
...
@@ -1090,8 +1089,14 @@ class Workflow(IdAsReferenceMixin("", "prefix"), XMLObject):
...
@@ -1090,8 +1089,14 @@ class Workflow(IdAsReferenceMixin("", "prefix"), XMLObject):
res
[
id
]
=
value
res
[
id
]
=
value
# Always provide the state variable.
# Always provide the state variable.
state_var
=
self
.
state_var
state_var
=
self
.
getStateVariable
()
res
[
state_var
]
=
status
.
get
(
state_var
,
self
.
initial_state
)
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
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