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
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Sebastien Robin
erp5
Commits
e1c6bea4
Commit
e1c6bea4
authored
Jun 29, 2016
by
iv
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ERP5Workflow: fix more uncorrectly named method (changed List to Dict)
parent
f64bbdd2
Changes
18
Hide whitespace changes
Inline
Side-by-side
Showing
18 changed files
with
35 additions
and
35 deletions
+35
-35
bt5/erp5_forge/SkinTemplateItem/portal_skins/erp5_glossary/GlossaryModule_getBusinessFieldWorkflowList.py
...5_glossary/GlossaryModule_getBusinessFieldWorkflowList.py
+1
-1
bt5/erp5_forge/SkinTemplateItem/portal_skins/erp5_glossary/GlossaryModule_getTermDictListFromWorkflow.py
...p5_glossary/GlossaryModule_getTermDictListFromWorkflow.py
+1
-1
bt5/erp5_forge/SkinTemplateItem/portal_skins/erp5_toolbox/ERP5Site_getToBeTranslatedMessageListFromEntireSystemAsPot.py
...Site_getToBeTranslatedMessageListFromEntireSystemAsPot.py
+1
-1
bt5/erp5_graph_editor/SkinTemplateItem/portal_skins/erp5_graph_editor/Workflow_getGraph.xml
...Item/portal_skins/erp5_graph_editor/Workflow_getGraph.xml
+1
-1
product/ERP5/ERP5Site.py
product/ERP5/ERP5Site.py
+3
-3
product/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/Base_getWorkflowHistoryItemList.py
...portal_skins/erp5_core/Base_getWorkflowHistoryItemList.py
+1
-1
product/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/Base_getWorkflowStateItemList.py
...m/portal_skins/erp5_core/Base_getWorkflowStateItemList.py
+1
-1
product/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/ERP5Site_checkNamingConventions.py
...portal_skins/erp5_core/ERP5Site_checkNamingConventions.py
+1
-1
product/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/ERP5Site_getWorkflowStateItemList.py
...rtal_skins/erp5_core/ERP5Site_getWorkflowStateItemList.py
+3
-3
product/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/ERP5Site_updateTranslationTable.py
...portal_skins/erp5_core/ERP5Site_updateTranslationTable.py
+2
-2
product/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/Folder_generateWorkflowReport.py
...m/portal_skins/erp5_core/Folder_generateWorkflowReport.py
+1
-1
product/ERP5/tests/testInventory.py
product/ERP5/tests/testInventory.py
+1
-1
product/ERP5Configurator/Document/WorkflowSecurityConfiguratorItem.py
...Configurator/Document/WorkflowSecurityConfiguratorItem.py
+1
-1
product/ERP5Form/Extensions/Folder_viewSearchDialog.py
product/ERP5Form/Extensions/Folder_viewSearchDialog.py
+3
-3
product/ERP5Type/patches/DCWorkflow.py
product/ERP5Type/patches/DCWorkflow.py
+4
-4
product/ERP5Type/tests/testERP5Type.py
product/ERP5Type/tests/testERP5Type.py
+1
-1
product/ERP5Workflow/Document/InteractionWorkflow.py
product/ERP5Workflow/Document/InteractionWorkflow.py
+2
-2
product/ERP5Workflow/Document/Workflow.py
product/ERP5Workflow/Document/Workflow.py
+7
-7
No files found.
bt5/erp5_forge/SkinTemplateItem/portal_skins/erp5_glossary/GlossaryModule_getBusinessFieldWorkflowList.py
View file @
e1c6bea4
...
@@ -26,7 +26,7 @@ def get_obj_and_reference_list(business_field):
...
@@ -26,7 +26,7 @@ def get_obj_and_reference_list(business_field):
wf
=
getattr
(
portal_workflow
,
wf_id
)
wf
=
getattr
(
portal_workflow
,
wf_id
)
if
getattr
(
wf
,
"interactions"
,
marker
)
is
marker
:
# only way to make sure it is not an interaction workflow ?
if
getattr
(
wf
,
"interactions"
,
marker
)
is
marker
:
# only way to make sure it is not an interaction workflow ?
result
.
append
((
wf
,
wf_id
,
'workflow'
))
result
.
append
((
wf
,
wf_id
,
'workflow'
))
for
state_id
,
state
in
wf
.
getStateValue
Lis
t
().
items
():
for
state_id
,
state
in
wf
.
getStateValue
Dic
t
().
items
():
result
.
append
((
state
,
state_id
,
'state'
))
result
.
append
((
state
,
state_id
,
'state'
))
for
trans_id
,
trans
in
wf
.
getTransitionValueDict
().
items
():
for
trans_id
,
trans
in
wf
.
getTransitionValueDict
().
items
():
result
.
append
((
trans
,
trans_id
,
'transition'
))
result
.
append
((
trans
,
trans_id
,
'transition'
))
...
...
bt5/erp5_forge/SkinTemplateItem/portal_skins/erp5_glossary/GlossaryModule_getTermDictListFromWorkflow.py
View file @
e1c6bea4
...
@@ -26,7 +26,7 @@ def get_obj_and_reference_list(business_field):
...
@@ -26,7 +26,7 @@ def get_obj_and_reference_list(business_field):
wf
=
getattr
(
portal_workflow
,
wf_id
)
wf
=
getattr
(
portal_workflow
,
wf_id
)
if
getattr
(
wf
,
"interactions"
,
marker
)
is
marker
:
# only way to make sure it is not an interaction workflow ?
if
getattr
(
wf
,
"interactions"
,
marker
)
is
marker
:
# only way to make sure it is not an interaction workflow ?
result
.
append
((
wf
,
wf_id
,
'workflow'
))
result
.
append
((
wf
,
wf_id
,
'workflow'
))
for
state_id
,
state
in
wf
.
getStateValue
Lis
t
().
items
():
for
state_id
,
state
in
wf
.
getStateValue
Dic
t
().
items
():
result
.
append
((
state
,
state_id
,
'state'
))
result
.
append
((
state
,
state_id
,
'state'
))
for
trans_id
,
trans
in
wf
.
getTransitionValueDict
().
items
():
for
trans_id
,
trans
in
wf
.
getTransitionValueDict
().
items
():
result
.
append
((
trans
,
trans_id
,
'transition'
))
result
.
append
((
trans
,
trans_id
,
'transition'
))
...
...
bt5/erp5_forge/SkinTemplateItem/portal_skins/erp5_toolbox/ERP5Site_getToBeTranslatedMessageListFromEntireSystemAsPot.py
View file @
e1c6bea4
...
@@ -107,7 +107,7 @@ for i in page_template_list:
...
@@ -107,7 +107,7 @@ for i in page_template_list:
s_title_list
=
[]
s_title_list
=
[]
for
i
in
context
.
portal_workflow
.
objectValues
():
for
i
in
context
.
portal_workflow
.
objectValues
():
add_message
(
i
.
title_or_id
(),
portal_url
.
getRelativeContentURL
(
i
))
add_message
(
i
.
title_or_id
(),
portal_url
.
getRelativeContentURL
(
i
))
state_value_dict
=
i
.
getStateValue
Lis
t
()
state_value_dict
=
i
.
getStateValue
Dic
t
()
if
not
state_value_dict
:
if
not
state_value_dict
:
continue
continue
for
s_id
,
s
in
state_value_dict
.
items
():
for
s_id
,
s
in
state_value_dict
.
items
():
...
...
bt5/erp5_graph_editor/SkinTemplateItem/portal_skins/erp5_graph_editor/Workflow_getGraph.xml
View file @
e1c6bea4
...
@@ -65,7 +65,7 @@ if position_graph:\n
...
@@ -65,7 +65,7 @@ if position_graph:\n
\n
\n
def getWorkflowGraph(workflow):\n
def getWorkflowGraph(workflow):\n
graph = dict(node=dict(), edge=dict())\n
graph = dict(node=dict(), edge=dict())\n
for state_id, state in workflow.getStateValue
Lis
t().iteritems():\n
for state_id, state in workflow.getStateValue
Dic
t().iteritems():\n
is_initial_state = state.getId() == workflow.getSourceId()\n
is_initial_state = state.getId() == workflow.getSourceId()\n
transition_id_list = []\n
transition_id_list = []\n
graph[\'node\'][state.getId()] = dict(\n
graph[\'node\'][state.getId()] = dict(\n
...
...
product/ERP5/ERP5Site.py
View file @
e1c6bea4
...
@@ -773,7 +773,7 @@ class ERP5Site(FolderMixIn, CMFSite, CacheCookieMixin):
...
@@ -773,7 +773,7 @@ class ERP5Site(FolderMixIn, CMFSite, CacheCookieMixin):
def
getStateList
(
group
):
def
getStateList
(
group
):
state_dict
=
{}
state_dict
=
{}
for
wf
in
self
.
portal_workflow
.
objectValues
():
for
wf
in
self
.
portal_workflow
.
objectValues
():
state_list
=
wf
.
getStateValue
Lis
t
()
state_list
=
wf
.
getStateValue
Dic
t
()
for
state_id
in
state_list
:
for
state_id
in
state_list
:
state
=
state_list
[
state_id
]
state
=
state_list
[
state_id
]
if
group
in
getattr
(
state
,
'type_list'
,
()):
if
group
in
getattr
(
state
,
'type_list'
,
()):
...
@@ -1300,8 +1300,8 @@ class ERP5Site(FolderMixIn, CMFSite, CacheCookieMixin):
...
@@ -1300,8 +1300,8 @@ class ERP5Site(FolderMixIn, CMFSite, CacheCookieMixin):
def
getStateList
():
def
getStateList
():
state_dict
=
{}
state_dict
=
{}
for
wf
in
self
.
portal_workflow
.
objectValues
():
for
wf
in
self
.
portal_workflow
.
objectValues
():
if
wf
.
getVariableValue
Lis
t
()
and
wf
.
getStateVariable
()
==
'simulation_state'
:
if
wf
.
getVariableValue
Dic
t
()
and
wf
.
getStateVariable
()
==
'simulation_state'
:
state_list
=
wf
.
getStateValue
Lis
t
()
state_list
=
wf
.
getStateValue
Dic
t
()
for
state_id
in
state_list
:
for
state_id
in
state_list
:
state
=
state_list
[
state_id
]
state
=
state_list
[
state_id
]
if
getattr
(
state
,
'type_list'
,
None
):
if
getattr
(
state
,
'type_list'
,
None
):
...
...
product/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/Base_getWorkflowHistoryItemList.py
View file @
e1c6bea4
...
@@ -40,7 +40,7 @@ for history_name in ['history', 'building_history', 'installation_history']:
...
@@ -40,7 +40,7 @@ for history_name in ['history', 'building_history', 'installation_history']:
workflow
=
getattr
(
portal_workflow
,
workflow_id
)
workflow
=
getattr
(
portal_workflow
,
workflow_id
)
wf_state_var
=
workflow
.
getStateVariable
()
wf_state_var
=
workflow
.
getStateVariable
()
wf_states
=
workflow
.
getStateValue
Lis
t
()
wf_states
=
workflow
.
getStateValue
Dic
t
()
wf_transitions
=
workflow
.
getTransitionValueDict
()
wf_transitions
=
workflow
.
getTransitionValueDict
()
next_serial
=
None
next_serial
=
None
...
...
product/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/Base_getWorkflowStateItemList.py
View file @
e1c6bea4
...
@@ -11,7 +11,7 @@ state_dict = {}
...
@@ -11,7 +11,7 @@ state_dict = {}
item_list
=
[]
item_list
=
[]
for
workflow_id
in
workflow_id_list
:
for
workflow_id
in
workflow_id_list
:
workflow
=
getToolByName
(
context
,
'portal_workflow'
)[
workflow_id
]
workflow
=
getToolByName
(
context
,
'portal_workflow'
)[
workflow_id
]
for
state_id
,
state
in
workflow
.
getStateValue
Lis
t
().
items
():
for
state_id
,
state
in
workflow
.
getStateValue
Dic
t
().
items
():
if
state
.
title
and
state_id
!=
'deleted'
:
if
state
.
title
and
state_id
!=
'deleted'
:
if
not
state_dict
.
has_key
(
state_id
):
if
not
state_dict
.
has_key
(
state_id
):
# we hide states without titles
# we hide states without titles
...
...
product/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/ERP5Site_checkNamingConventions.py
View file @
e1c6bea4
...
@@ -183,7 +183,7 @@ for folder in context.portal_skins.objectValues(spec=('Folder',)):
...
@@ -183,7 +183,7 @@ for folder in context.portal_skins.objectValues(spec=('Folder',)):
for
wf
in
context
.
portal_workflow
.
objectValues
():
for
wf
in
context
.
portal_workflow
.
objectValues
():
# Test workflow states
# Test workflow states
wf_states
=
wf
.
getStateValue
Lis
t
()
wf_states
=
wf
.
getStateValue
Dic
t
()
message
=
''
message
=
''
if
wf_states
not
in
(
None
,
(),
[],
''
):
if
wf_states
not
in
(
None
,
(),
[],
''
):
for
state_id
in
wf_states
.
keys
():
for
state_id
in
wf_states
.
keys
():
...
...
product/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/ERP5Site_getWorkflowStateItemList.py
View file @
e1c6bea4
...
@@ -34,15 +34,15 @@ for portal_type in portal_type:
...
@@ -34,15 +34,15 @@ for portal_type in portal_type:
workflow
=
workflow_tool
[
workflow_id
]
workflow
=
workflow_tool
[
workflow_id
]
# skip interaction workflows or workflows with only one state (such as edit_workflow)
# skip interaction workflows or workflows with only one state (such as edit_workflow)
if
workflow
.
getStateValue
Lis
t
()
is
None
or
len
(
workflow
.
getStateIdList
())
<=
1
:
if
workflow
.
getStateValue
Dic
t
()
is
None
or
len
(
workflow
.
getStateIdList
())
<=
1
:
continue
continue
# skip workflows using another state variable
# skip workflows using another state variable
if
state_var
not
in
(
None
,
workflow
.
getStateVariable
()):
if
state_var
not
in
(
None
,
workflow
.
getStateVariable
()):
continue
continue
for
state_id
in
workflow
.
getStateValue
Lis
t
():
for
state_id
in
workflow
.
getStateValue
Dic
t
():
state
=
workflow
.
getStateValue
Lis
t
().
get
(
state_id
)
state
=
workflow
.
getStateValue
Dic
t
().
get
(
state_id
)
if
state_id
in
state_set
:
if
state_id
in
state_set
:
continue
continue
state_set
.
add
(
state_id
)
state_set
.
add
(
state_id
)
...
...
product/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/ERP5Site_updateTranslationTable.py
View file @
e1c6bea4
...
@@ -32,8 +32,8 @@ for portal_type in portal_type_list:
...
@@ -32,8 +32,8 @@ for portal_type in portal_type_list:
if
wf
is
None
:
if
wf
is
None
:
continue
continue
state_var
=
wf
.
getStateVariable
()
state_var
=
wf
.
getStateVariable
()
if
wf
.
getStateValue
Lis
t
():
if
wf
.
getStateValue
Dic
t
():
state_value_list
=
wf
.
getStateValue
Lis
t
()
state_value_list
=
wf
.
getStateValue
Dic
t
()
for
state_ref
,
state
in
state_value_list
.
items
():
for
state_ref
,
state
in
state_value_list
.
items
():
for
lang
in
supported_languages
:
for
lang
in
supported_languages
:
key
=
(
lang
,
pt_id
,
state_var
,
state_ref
)
key
=
(
lang
,
pt_id
,
state_var
,
state_ref
)
...
...
product/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/Folder_generateWorkflowReport.py
View file @
e1c6bea4
...
@@ -12,7 +12,7 @@ for portal_type in context.allowedContentTypes():
...
@@ -12,7 +12,7 @@ for portal_type in context.allowedContentTypes():
portal_type_id
=
portal_type
.
getId
()
portal_type_id
=
portal_type
.
getId
()
portal_type_translated_title_dict
[
portal_type_id
]
=
translateString
(
portal_type
.
getTitle
())
portal_type_translated_title_dict
[
portal_type_id
]
=
translateString
(
portal_type
.
getTitle
())
for
workflow
in
getWorkflowsFor
(
portal_type_id
):
for
workflow
in
getWorkflowsFor
(
portal_type_id
):
state_container
=
workflow
.
getStateValue
Lis
t
()
state_container
=
workflow
.
getStateValue
Dic
t
()
if
state_container
is
not
None
and
len
(
state_container
)
>
1
:
if
state_container
is
not
None
and
len
(
state_container
)
>
1
:
state_var
=
workflow
.
getStateVariable
()
state_var
=
workflow
.
getStateVariable
()
if
state_var
is
None
:
if
state_var
is
None
:
...
...
product/ERP5/tests/testInventory.py
View file @
e1c6bea4
...
@@ -2742,7 +2742,7 @@ class TestInventory(TestOrderMixin, ERP5TypeTestCase):
...
@@ -2742,7 +2742,7 @@ class TestInventory(TestOrderMixin, ERP5TypeTestCase):
Make sure that changing workflow state after delivered changes
Make sure that changing workflow state after delivered changes
records in stock table.
records in stock table.
"""
"""
delivered_state
=
self
.
portal
.
portal_workflow
.
inventory_workflow
.
getStateValue
Lis
t
()[
'delivered'
]
delivered_state
=
self
.
portal
.
portal_workflow
.
inventory_workflow
.
getStateValue
Dic
t
()[
'delivered'
]
delivered_state
.
addPossibleTransition
(
'cancel'
)
delivered_state
.
addPossibleTransition
(
'cancel'
)
self
.
commit
()
self
.
commit
()
...
...
product/ERP5Configurator/Document/WorkflowSecurityConfiguratorItem.py
View file @
e1c6bea4
...
@@ -88,7 +88,7 @@ class WorkflowSecurityConfiguratorItem(ConfiguratorItemMixin, XMLObject):
...
@@ -88,7 +88,7 @@ class WorkflowSecurityConfiguratorItem(ConfiguratorItemMixin, XMLObject):
state_list
=
table_dict
[
'state'
]
state_list
=
table_dict
[
'state'
]
for
state_config
in
state_list
:
for
state_config
in
state_list
:
state_id
=
state_config
.
pop
(
'state'
)
state_id
=
state_config
.
pop
(
'state'
)
state
=
workflow
.
getStateValue
Lis
t
()[
state_id
]
state
=
workflow
.
getStateValue
Dic
t
()[
state_id
]
# Clean the state matrix
# Clean the state matrix
for
permission
in
permission_list
:
for
permission
in
permission_list
:
state
.
setPermission
(
permission
,
0
,
[])
state
.
setPermission
(
permission
,
0
,
[])
...
...
product/ERP5Form/Extensions/Folder_viewSearchDialog.py
View file @
e1c6bea4
...
@@ -328,8 +328,8 @@ def getSearchDialog(self, REQUEST=None):
...
@@ -328,8 +328,8 @@ def getSearchDialog(self, REQUEST=None):
continue
continue
workflow_set
.
add
(
state_var
)
workflow_set
.
add
(
state_var
)
if
workflow
.
getStateValue
Lis
t
()
is
None
or
\
if
workflow
.
getStateValue
Dic
t
()
is
None
or
\
len
(
workflow
.
getStateValue
Lis
t
())
<=
1
:
len
(
workflow
.
getStateValue
Dic
t
())
<=
1
:
continue
continue
field_id
=
'your_%s'
%
state_var
field_id
=
'your_%s'
%
state_var
...
@@ -340,7 +340,7 @@ def getSearchDialog(self, REQUEST=None):
...
@@ -340,7 +340,7 @@ def getSearchDialog(self, REQUEST=None):
form_id
=
'Base_viewDialogFieldLibrary'
,
form_id
=
'Base_viewDialogFieldLibrary'
,
field_id
=
'your_category_list'
))
field_id
=
'your_category_list'
))
items
=
sorted
([(
translateString
(
x
.
title
),
x
.
id
)
for
x_ref
,
x
items
=
sorted
([(
translateString
(
x
.
title
),
x
.
id
)
for
x_ref
,
x
in
workflow
.
getStateValue
Lis
t
().
items
()],
in
workflow
.
getStateValue
Dic
t
().
items
()],
key
=
lambda
x
:
str
(
x
[
0
]))
key
=
lambda
x
:
str
(
x
[
0
]))
field
.
_surcharged_edit
(
field
.
_surcharged_edit
(
dict
(
title
=
translateString
(
workflow
.
title
),
dict
(
title
=
translateString
(
workflow
.
title
),
...
...
product/ERP5Type/patches/DCWorkflow.py
View file @
e1c6bea4
...
@@ -792,7 +792,7 @@ def DCWorkflowDefinition_notifySuccess(self, ob, transition_list, result, args=N
...
@@ -792,7 +792,7 @@ def DCWorkflowDefinition_notifySuccess(self, ob, transition_list, result, args=N
pass
pass
# following 15 patches are required for the new workflow tool compatibility.
# following 15 patches are required for the new workflow tool compatibility.
def
DCWorkflowDefinition_getVariableValue
Lis
t
(
self
):
def
DCWorkflowDefinition_getVariableValue
Dic
t
(
self
):
if
self
.
variables
is
not
None
:
if
self
.
variables
is
not
None
:
return
self
.
variables
return
self
.
variables
return
{}
return
{}
...
@@ -802,7 +802,7 @@ def DCWorkflowDefinition_getVariableIdList(self):
...
@@ -802,7 +802,7 @@ def DCWorkflowDefinition_getVariableIdList(self):
return
[]
return
[]
def
DCWorkflowDefinition_getStateVariable
(
self
):
def
DCWorkflowDefinition_getStateVariable
(
self
):
return
self
.
state_var
return
self
.
state_var
def
DCWorkflowDefinition_getStateValue
Lis
t
(
self
):
def
DCWorkflowDefinition_getStateValue
Dic
t
(
self
):
if
self
.
states
is
not
None
:
if
self
.
states
is
not
None
:
return
self
.
states
return
self
.
states
return
{}
return
{}
...
@@ -1084,8 +1084,8 @@ DCWorkflowDefinition.getSourceValue = DCWorkflowDefinition_getSourceValue
...
@@ -1084,8 +1084,8 @@ DCWorkflowDefinition.getSourceValue = DCWorkflowDefinition_getSourceValue
DCWorkflowDefinition
.
notifyWorkflowMethod
=
DCWorkflowDefinition_notifyWorkflowMethod
DCWorkflowDefinition
.
notifyWorkflowMethod
=
DCWorkflowDefinition_notifyWorkflowMethod
DCWorkflowDefinition
.
notifyBefore
=
DCWorkflowDefinition_notifyBefore
DCWorkflowDefinition
.
notifyBefore
=
DCWorkflowDefinition_notifyBefore
DCWorkflowDefinition
.
notifySuccess
=
DCWorkflowDefinition_notifySuccess
DCWorkflowDefinition
.
notifySuccess
=
DCWorkflowDefinition_notifySuccess
DCWorkflowDefinition
.
getVariableValue
List
=
DCWorkflowDefinition_getVariableValueLis
t
DCWorkflowDefinition
.
getVariableValue
Dict
=
DCWorkflowDefinition_getVariableValueDic
t
DCWorkflowDefinition
.
getStateValue
List
=
DCWorkflowDefinition_getStateValueLis
t
DCWorkflowDefinition
.
getStateValue
Dict
=
DCWorkflowDefinition_getStateValueDic
t
DCWorkflowDefinition
.
getTransitionValueDict
=
DCWorkflowDefinition_getTransitionValueDict
DCWorkflowDefinition
.
getTransitionValueDict
=
DCWorkflowDefinition_getTransitionValueDict
DCWorkflowDefinition
.
getWorklistValueDict
=
DCWorkflowDefinition_getWorklistValueDict
DCWorkflowDefinition
.
getWorklistValueDict
=
DCWorkflowDefinition_getWorklistValueDict
DCWorkflowDefinition
.
getScriptValueDict
=
DCWorkflowDefinition_getScriptValueDict
DCWorkflowDefinition
.
getScriptValueDict
=
DCWorkflowDefinition_getScriptValueDict
...
...
product/ERP5Type/tests/testERP5Type.py
View file @
e1c6bea4
...
@@ -970,7 +970,7 @@ class TestERP5Type(PropertySheetTestCase, LogInterceptor):
...
@@ -970,7 +970,7 @@ class TestERP5Type(PropertySheetTestCase, LogInterceptor):
self
.
getWorkflowTool
().
getWorkflowValueListFor
(
'Person'
))
self
.
getWorkflowTool
().
getWorkflowValueListFor
(
'Person'
))
self
.
assertEqual
(
'validation_state'
,
wf
.
getStateVariable
())
self
.
assertEqual
(
'validation_state'
,
wf
.
getStateVariable
())
initial_state
=
wf
.
getSourceValue
()
initial_state
=
wf
.
getSourceValue
()
other_state
=
wf
.
getStateValue
Lis
t
()[
'validated'
]
other_state
=
wf
.
getStateValue
Dic
t
()[
'validated'
]
self
.
assertTrue
(
hasattr
(
person
,
'getValidationState'
))
self
.
assertTrue
(
hasattr
(
person
,
'getValidationState'
))
self
.
assertTrue
(
hasattr
(
person
,
'getValidationStateTitle'
))
self
.
assertTrue
(
hasattr
(
person
,
'getValidationStateTitle'
))
...
...
product/ERP5Workflow/Document/InteractionWorkflow.py
View file @
e1c6bea4
...
@@ -118,7 +118,7 @@ class InteractionWorkflow(IdAsReferenceMixin("", "prefix"), Workflow):
...
@@ -118,7 +118,7 @@ class InteractionWorkflow(IdAsReferenceMixin("", "prefix"), Workflow):
'''
'''
Returns a true value if the given info name is supported.
Returns a true value if the given info name is supported.
'''
'''
vdef
=
self
.
getVariableValue
Lis
t
().
get
(
name
,
None
)
vdef
=
self
.
getVariableValue
Dic
t
().
get
(
name
,
None
)
if
vdef
is
None
:
if
vdef
is
None
:
return
0
return
0
return
1
return
1
...
@@ -367,7 +367,7 @@ class InteractionWorkflow(IdAsReferenceMixin("", "prefix"), Workflow):
...
@@ -367,7 +367,7 @@ class InteractionWorkflow(IdAsReferenceMixin("", "prefix"), Workflow):
return
1
return
1
return
0
return
0
def
getStateValue
Lis
t
(
self
):
def
getStateValue
Dic
t
(
self
):
return
{}
return
{}
def
showAsXML
(
self
,
root
=
None
):
def
showAsXML
(
self
,
root
=
None
):
...
...
product/ERP5Workflow/Document/Workflow.py
View file @
e1c6bea4
...
@@ -196,7 +196,7 @@ class Workflow(IdAsReferenceMixin("", "prefix"), XMLObject):
...
@@ -196,7 +196,7 @@ class Workflow(IdAsReferenceMixin("", "prefix"), XMLObject):
'''
'''
if
name
==
self
.
getStateVariable
():
if
name
==
self
.
getStateVariable
():
return
1
return
1
vdef
=
self
.
getVariableValue
Lis
t
().
get
(
name
,
None
)
vdef
=
self
.
getVariableValue
Dic
t
().
get
(
name
,
None
)
if
vdef
is
None
:
if
vdef
is
None
:
return
0
return
0
return
1
return
1
...
@@ -424,7 +424,7 @@ class Workflow(IdAsReferenceMixin("", "prefix"), XMLObject):
...
@@ -424,7 +424,7 @@ class Workflow(IdAsReferenceMixin("", "prefix"), XMLObject):
'''
'''
if
name
==
self
.
getStateVariable
():
if
name
==
self
.
getStateVariable
():
return
self
.
_getWorkflowStateOf
(
ob
,
1
)
return
self
.
_getWorkflowStateOf
(
ob
,
1
)
vdef
=
self
.
getVariableValue
Lis
t
()[
name
]
vdef
=
self
.
getVariableValue
Dic
t
()[
name
]
if
vdef
.
getInfoGuard
()
is
not
None
and
not
vdef
.
getInfoGuard
().
check
(
if
vdef
.
getInfoGuard
()
is
not
None
and
not
vdef
.
getInfoGuard
().
check
(
getSecurityManager
(),
self
,
ob
):
getSecurityManager
(),
self
,
ob
):
return
default
return
default
...
@@ -478,7 +478,7 @@ class Workflow(IdAsReferenceMixin("", "prefix"), XMLObject):
...
@@ -478,7 +478,7 @@ class Workflow(IdAsReferenceMixin("", "prefix"), XMLObject):
else
:
else
:
return
state
return
state
def
getVariableValue
Lis
t
(
self
):
def
getVariableValue
Dic
t
(
self
):
variable_dict
=
{}
variable_dict
=
{}
for
vdef
in
self
.
objectValues
(
portal_type
=
"Variable"
):
for
vdef
in
self
.
objectValues
(
portal_type
=
"Variable"
):
variable_dict
[
vdef
.
getReference
()]
=
vdef
variable_dict
[
vdef
.
getReference
()]
=
vdef
...
@@ -490,7 +490,7 @@ class Workflow(IdAsReferenceMixin("", "prefix"), XMLObject):
...
@@ -490,7 +490,7 @@ class Workflow(IdAsReferenceMixin("", "prefix"), XMLObject):
id_list
.
append
(
ob
.
getReference
())
id_list
.
append
(
ob
.
getReference
())
return
id_list
return
id_list
def
getStateValue
Lis
t
(
self
):
def
getStateValue
Dic
t
(
self
):
state_dict
=
{}
state_dict
=
{}
for
sdef
in
self
.
objectValues
(
portal_type
=
"State"
):
for
sdef
in
self
.
objectValues
(
portal_type
=
"State"
):
state_dict
[
sdef
.
getReference
()]
=
sdef
state_dict
[
sdef
.
getReference
()]
=
sdef
...
@@ -1050,13 +1050,13 @@ class Workflow(IdAsReferenceMixin("", "prefix"), XMLObject):
...
@@ -1050,13 +1050,13 @@ class Workflow(IdAsReferenceMixin("", "prefix"), XMLObject):
raise
WorkflowException
,
(
'Destination state undefined: '
+
new_state_id
)
raise
WorkflowException
,
(
'Destination state undefined: '
+
new_state_id
)
# Update variables.
# Update variables.
state_values
=
self
.
getVariableValue
Lis
t
()
state_values
=
self
.
getVariableValue
Dic
t
()
if
state_values
is
None
:
if
state_values
is
None
:
state_values
=
{}
state_values
=
{}
tdef_exprs
=
{}
tdef_exprs
=
{}
status
=
{}
status
=
{}
for
id
,
vdef
in
self
.
getVariableValue
Lis
t
().
items
():
for
id
,
vdef
in
self
.
getVariableValue
Dic
t
().
items
():
if
vdef
.
getForStatus
()
==
0
:
if
vdef
.
getForStatus
()
==
0
:
continue
continue
expr
=
None
expr
=
None
...
@@ -1118,7 +1118,7 @@ class Workflow(IdAsReferenceMixin("", "prefix"), XMLObject):
...
@@ -1118,7 +1118,7 @@ class Workflow(IdAsReferenceMixin("", "prefix"), XMLObject):
# Always provide the state variable.
# Always provide the state variable.
state_var
=
self
.
getStateVariable
()
state_var
=
self
.
getStateVariable
()
status
=
self
.
getCurrentStatusDict
(
ob
)
status
=
self
.
getCurrentStatusDict
(
ob
)
for
vdef_ref
,
vdef
in
self
.
getVariableValue
Lis
t
().
iteritems
():
for
vdef_ref
,
vdef
in
self
.
getVariableValue
Dic
t
().
iteritems
():
if
vdef
.
getForCatalog
():
if
vdef
.
getForCatalog
():
default_expr
=
vdef
.
getDefaultExpr
()
default_expr
=
vdef
.
getDefaultExpr
()
if
status
.
has_key
(
vdef_ref
):
if
status
.
has_key
(
vdef_ref
):
...
...
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