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
f387101b
Commit
f387101b
authored
Jun 29, 2016
by
iv
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ERP5Workflow: provide consistent name for method returning dict
parent
d0bf8ed3
Changes
16
Hide whitespace changes
Inline
Side-by-side
Showing
16 changed files
with
36 additions
and
40 deletions
+36
-40
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
+4
-5
bt5/erp5_km/SkinTemplateItem/portal_skins/erp5_km/Base_getWorkflowWorklistInfo.py
...Item/portal_skins/erp5_km/Base_getWorkflowWorklistInfo.py
+1
-1
bt5/erp5_km/SkinTemplateItem/portal_skins/erp5_km/WebSite_getWorklistSettingsFor.py
...em/portal_skins/erp5_km/WebSite_getWorklistSettingsFor.py
+1
-1
product/ERP5/Extensions/CheckSkins.py
product/ERP5/Extensions/CheckSkins.py
+3
-6
product/ERP5/InteractionWorkflow.py
product/ERP5/InteractionWorkflow.py
+1
-1
product/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/Base_getWorkflowHistoryItemList.py
...portal_skins/erp5_core/Base_getWorkflowHistoryItemList.py
+1
-1
product/ERP5Configurator/Document/WorkflowSecurityConfiguratorItem.py
...Configurator/Document/WorkflowSecurityConfiguratorItem.py
+1
-1
product/ERP5Type/Base.py
product/ERP5Type/Base.py
+2
-2
product/ERP5Type/Tool/TypesTool.py
product/ERP5Type/Tool/TypesTool.py
+1
-1
product/ERP5Type/patches/DCWorkflow.py
product/ERP5Type/patches/DCWorkflow.py
+6
-6
product/ERP5Type/patches/Expression.py
product/ERP5Type/patches/Expression.py
+3
-3
product/ERP5Type/tests/SecurityTestCase.py
product/ERP5Type/tests/SecurityTestCase.py
+1
-1
product/ERP5Workflow/Document/InteractionWorkflow.py
product/ERP5Workflow/Document/InteractionWorkflow.py
+4
-4
product/ERP5Workflow/Document/Workflow.py
product/ERP5Workflow/Document/Workflow.py
+5
-5
No files found.
bt5/erp5_forge/SkinTemplateItem/portal_skins/erp5_glossary/GlossaryModule_getBusinessFieldWorkflowList.py
View file @
f387101b
...
...
@@ -28,7 +28,7 @@ def get_obj_and_reference_list(business_field):
result
.
append
((
wf
,
wf_id
,
'workflow'
))
for
state_id
,
state
in
wf
.
getStateValueList
().
items
():
result
.
append
((
state
,
state_id
,
'state'
))
for
trans_id
,
trans
in
wf
.
getTransitionValue
Lis
t
().
items
():
for
trans_id
,
trans
in
wf
.
getTransitionValue
Dic
t
().
items
():
result
.
append
((
trans
,
trans_id
,
'transition'
))
if
trans
.
trigger_type
==
1
and
trans
.
actbox_name
:
# 1 == TRIGGER_USER_ACTION
result
.
append
((
trans
,
"%s_actbox_name"
%
trans_id
,
'action'
))
...
...
bt5/erp5_forge/SkinTemplateItem/portal_skins/erp5_glossary/GlossaryModule_getTermDictListFromWorkflow.py
View file @
f387101b
...
...
@@ -28,7 +28,7 @@ def get_obj_and_reference_list(business_field):
result
.
append
((
wf
,
wf_id
,
'workflow'
))
for
state_id
,
state
in
wf
.
getStateValueList
().
items
():
result
.
append
((
state
,
state_id
,
'state'
))
for
trans_id
,
trans
in
wf
.
getTransitionValue
Lis
t
().
items
():
for
trans_id
,
trans
in
wf
.
getTransitionValue
Dic
t
().
items
():
result
.
append
((
trans
,
trans_id
,
'transition'
))
if
trans
.
trigger_type
==
1
and
trans
.
actbox_name
:
# 1 == TRIGGER_USER_ACTION
result
.
append
((
trans
,
"%s_actbox_name"
%
trans_id
,
'action'
))
...
...
bt5/erp5_forge/SkinTemplateItem/portal_skins/erp5_toolbox/ERP5Site_getToBeTranslatedMessageListFromEntireSystemAsPot.py
View file @
f387101b
...
...
@@ -40,8 +40,7 @@ iterate(context.portal_skins)
# Collect python script from workflow objects.
for
workflow
in
context
.
portal_workflow
.
objectValues
():
script_value_dict
=
workflow
.
getScriptValueList
()
for
i_id
,
i
in
script_value_dict
.
items
():
for
i
in
workflow
.
getScriptValueDict
().
values
():
if
i
.
meta_type
==
'Script (Python)'
:
python_script_list
.
append
(
i
)
...
...
@@ -120,10 +119,10 @@ for i in context.portal_workflow.objectValues():
# also use state title as msg_id for compatibility
add_message
(
s_title
,
portal_url
.
getRelativeContentURL
(
s
))
transition_value_dict
=
i
.
getTransitionValue
Lis
t
()
transition_value_dict
=
i
.
getTransitionValue
Dic
t
()
if
not
transition_value_dict
:
continue
for
t
_id
,
t
in
transition_value_dict
.
item
s
():
for
t
in
transition_value_dict
.
value
s
():
if
t
.
actbox_name
:
#adding a context in msg_id for more precise translation
msg_id
=
getMessageIdWithContext
(
t
.
actbox_name
,
'transition'
,
i
.
id
)
...
...
@@ -136,7 +135,7 @@ for i in context.portal_workflow.objectValues():
add_message
(
msg_id
,
portal_url
.
getRelativeContentURL
(
t
))
# also use transition title as msg_id for compatibility
add_message
(
t
.
title
,
portal_url
.
getRelativeContentURL
(
t
))
for
worklist
_id
,
worklist
in
i
.
getWorklistValueList
().
item
s
():
for
worklist
in
i
.
getWorklistValueDict
().
value
s
():
add_message
(
worklist
.
actbox_name
,
portal_url
.
getRelativeContentURL
(
worklist
))
...
...
bt5/erp5_km/SkinTemplateItem/portal_skins/erp5_km/Base_getWorkflowWorklistInfo.py
View file @
f387101b
...
...
@@ -5,6 +5,6 @@
portal_workflow
=
context
.
getPortalObject
().
portal_workflow
workflow
=
getattr
(
portal_workflow
,
workflow_id
)
worklist
=
workflow
.
getWorklistValue
Lis
t
()[
worklist_id
]
worklist
=
workflow
.
getWorklistValue
Dic
t
()[
worklist_id
]
roles
=
worklist
.
getGuard
().
getRolesText
().
split
(
';'
)
return
roles
bt5/erp5_km/SkinTemplateItem/portal_skins/erp5_km/WebSite_getWorklistSettingsFor.py
View file @
f387101b
...
...
@@ -14,7 +14,7 @@ except:
return
{}
# If this is a worklist action, read the worklist definition
worklist
=
workflow
.
getWorklistValue
Lis
t
()[
action
[
'worklist_id'
]]
worklist
=
workflow
.
getWorklistValue
Dic
t
()[
action
[
'worklist_id'
]]
for
varkey
in
worklist
.
getVarMatchKeys
():
kw
[
varkey
]
=
worklist
.
getVarMatch
(
varkey
)
...
...
product/ERP5/Extensions/CheckSkins.py
View file @
f387101b
...
...
@@ -310,8 +310,7 @@ def fixSkinNames(self, REQUEST=None, file=None, dry_run=0):
# Workflows.
for
wf
in
self
.
portal_workflow
.
objectValues
():
# Transitions.
Transition_value_dict
=
wf
.
getTransitionValueList
()
for
id
,
transition
in
Transition_value_dict
.
items
():
for
id
,
transition
in
wf
.
getTransitionValueDict
().
items
():
text
=
transition
.
actbox_url
for
info
in
info_list
:
if
info
.
regexp
.
search
(
text
)
is
not
None
:
...
...
@@ -323,8 +322,7 @@ def fixSkinNames(self, REQUEST=None, file=None, dry_run=0):
transition
.
actbox_url
=
text
break
# Worklists.
worklist_value_dict
=
wf
.
getWorklistValueList
()
for
id
,
worklist
in
worklist_value_dict
.
items
():
for
id
,
worklist
in
wf
.
getWorklistValueDict
().
items
():
text
=
worklist
.
actbox_url
for
info
in
info_list
:
if
info
.
regexp
.
search
(
text
)
is
not
None
:
...
...
@@ -336,8 +334,7 @@ def fixSkinNames(self, REQUEST=None, file=None, dry_run=0):
worklist
.
actbox_url
=
text
break
# Scripts.
script_value_dict
=
wf
.
getScriptValueList
()
for
id
,
script
in
script_value_dict
.
items
():
for
id
,
script
in
wf
.
getScriptValueDict
().
items
():
text
=
script
.
manage_FTPget
()
name_list
=
[]
for
info
in
info_list
:
...
...
product/ERP5/InteractionWorkflow.py
View file @
f387101b
...
...
@@ -352,7 +352,7 @@ class InteractionWorkflowDefinition (DCWorkflowDefinition, ActiveObject):
def
getReference
(
self
):
return
self
.
id
def
getTransitionValue
Lis
t
(
self
):
def
getTransitionValue
Dic
t
(
self
):
if
self
.
interactions
is
not
None
:
return
self
.
interactions
return
None
...
...
product/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/Base_getWorkflowHistoryItemList.py
View file @
f387101b
...
...
@@ -41,7 +41,7 @@ for history_name in ['history', 'building_history', 'installation_history']:
workflow
=
getattr
(
portal_workflow
,
workflow_id
)
wf_state_var
=
workflow
.
getStateVariable
()
wf_states
=
workflow
.
getStateValueList
()
wf_transitions
=
workflow
.
getTransitionValue
Lis
t
()
wf_transitions
=
workflow
.
getTransitionValue
Dic
t
()
next_serial
=
None
previous_obj
=
None
...
...
product/ERP5Configurator/Document/WorkflowSecurityConfiguratorItem.py
View file @
f387101b
...
...
@@ -116,7 +116,7 @@ class WorkflowSecurityConfiguratorItem(ConfiguratorItemMixin, XMLObject):
transition_list
=
table_dict
[
'transition'
]
for
transition_conf
in
transition_list
:
transition_id
=
transition_conf
.
pop
(
'transition'
)
transition
=
workflow
.
getTransitionValue
Lis
t
()[
transition_id
]
transition
=
workflow
.
getTransitionValue
Dic
t
()[
transition_id
]
guard
=
transition
.
getGuard
()
role_list
=
[
x
.
capitalize
()
for
x
in
transition_conf
.
keys
()]
role_string
=
';'
.
join
(
role_list
)
...
...
product/ERP5Type/Base.py
View file @
f387101b
...
...
@@ -519,10 +519,10 @@ def initializePortalTypeDynamicWorkflowMethods(ptype_klass, portal_workflow):
Permissions
.
AccessContentsInformation
)
storage
=
workflow_dict
transitions
=
wf
.
getTransitionValue
Lis
t
()
transitions
=
wf
.
getTransitionValue
Dic
t
()
elif
wf_type
in
[
'InteractionWorkflowDefinition'
,
'Interaction Workflow'
]:
storage
=
interaction_workflow_dict
transitions
=
wf
.
getTransitionValue
Lis
t
()
transitions
=
wf
.
getTransitionValue
Dic
t
()
else
:
continue
...
...
product/ERP5Type/Tool/TypesTool.py
View file @
f387101b
...
...
@@ -112,7 +112,7 @@ class TypesTool(TypeProvider):
pass
try
:
script
=
self
.
getPortalObject
().
portal_workflow
\
.
dynamic_class_generation_interaction_workflow
.
getScriptValue
Lis
t
()
\
.
dynamic_class_generation_interaction_workflow
.
getScriptValue
Dic
t
()
\
.
DynamicClassGeneration_resetDynamicDocuments
new
=
'.resetDynamicDocumentsOnceAtTransactionBoundary('
if
new
not
in
script
.
_body
:
...
...
product/ERP5Type/patches/DCWorkflow.py
View file @
f387101b
...
...
@@ -810,7 +810,7 @@ def DCWorkflowDefinition_getStateIdList(self):
if
self
.
states
is
not
None
:
return
self
.
states
.
objectIds
()
return
[]
def
DCWorkflowDefinition_getTransitionValue
Lis
t
(
self
):
def
DCWorkflowDefinition_getTransitionValue
Dic
t
(
self
):
if
self
.
transitions
is
not
None
:
return
self
.
transitions
else
:
...
...
@@ -819,7 +819,7 @@ def DCWorkflowDefinition_getTransitionIdList(self):
if
self
.
transitions
is
not
None
:
return
self
.
transitions
.
objectIds
()
return
[]
def
DCWorkflowDefinition_getWorklistValue
Lis
t
(
self
):
def
DCWorkflowDefinition_getWorklistValue
Dic
t
(
self
):
if
self
.
worklists
is
not
None
:
return
self
.
worklists
return
{}
...
...
@@ -829,7 +829,7 @@ def DCWorkflowDefinition_getWorklistIdList(self):
return
[]
def
DCWorkflowDefinition_propertyIds
(
self
):
return
sorted
(
self
.
__dict__
.
keys
())
def
DCWorkflowDefinition_getScriptValue
Lis
t
(
self
):
def
DCWorkflowDefinition_getScriptValue
Dic
t
(
self
):
if
self
.
scripts
is
not
None
:
return
self
.
scripts
return
{}
...
...
@@ -1086,9 +1086,9 @@ DCWorkflowDefinition.notifyBefore = DCWorkflowDefinition_notifyBefore
DCWorkflowDefinition
.
notifySuccess
=
DCWorkflowDefinition_notifySuccess
DCWorkflowDefinition
.
getVariableValueList
=
DCWorkflowDefinition_getVariableValueList
DCWorkflowDefinition
.
getStateValueList
=
DCWorkflowDefinition_getStateValueList
DCWorkflowDefinition
.
getTransitionValue
List
=
DCWorkflowDefinition_getTransitionValueLis
t
DCWorkflowDefinition
.
getWorklistValue
List
=
DCWorkflowDefinition_getWorklistValueLis
t
DCWorkflowDefinition
.
getScriptValue
List
=
DCWorkflowDefinition_getScriptValueLis
t
DCWorkflowDefinition
.
getTransitionValue
Dict
=
DCWorkflowDefinition_getTransitionValueDic
t
DCWorkflowDefinition
.
getWorklistValue
Dict
=
DCWorkflowDefinition_getWorklistValueDic
t
DCWorkflowDefinition
.
getScriptValue
Dict
=
DCWorkflowDefinition_getScriptValueDic
t
DCWorkflowDefinition
.
getVariableIdList
=
DCWorkflowDefinition_getVariableIdList
DCWorkflowDefinition
.
getStateIdList
=
DCWorkflowDefinition_getStateIdList
DCWorkflowDefinition
.
getTransitionIdList
=
DCWorkflowDefinition_getTransitionIdList
...
...
product/ERP5Type/patches/Expression.py
View file @
f387101b
...
...
@@ -36,7 +36,7 @@ def _createExprContext(sci):
'''
ob
=
sci
.
object
wf
=
sci
.
workflow
script
s
=
wf
.
getScriptValueLis
t
()
script
_dict
=
wf
.
getScriptValueDic
t
()
container
=
aq_parent
(
aq_inner
(
ob
))
data
=
{
'here'
:
ob
,
...
...
@@ -53,8 +53,8 @@ def _createExprContext(sci):
'status'
:
sci
.
status
,
'kwargs'
:
sci
.
kwargs
,
'workflow'
:
wf
,
'scripts'
:
script
s
,
'scripts'
:
script
_dict
,
}
return
getEngine
().
getContext
(
data
)
Expression
.
createExprContext
=
_createExprContext
\ No newline at end of file
Expression
.
createExprContext
=
_createExprContext
product/ERP5Type/tests/SecurityTestCase.py
View file @
f387101b
...
...
@@ -219,7 +219,7 @@ class SecurityTestCase(ERP5TypeTestCase):
continue
for
wf_transition_id
in
wf
.
_getWorkflowStateOf
(
document
).
getTransitions
():
wf_transition
=
wf
.
getTransitionValue
Lis
t
()[
wf_transition_id
]
wf_transition
=
wf
.
getTransitionValue
Dic
t
()[
wf_transition_id
]
if
wf_transition
.
trigger_type
==
TRIGGER_USER_ACTION
:
workflow_transitions_description
.
append
(
"%s%s[%s]: %s"
%
(
...
...
product/ERP5Workflow/Document/InteractionWorkflow.py
View file @
f387101b
...
...
@@ -187,15 +187,15 @@ class InteractionWorkflow(IdAsReferenceMixin("", "prefix"), Workflow):
def
_getWorkflowStateOf
(
self
,
ob
,
id_only
=
0
):
return
None
security
.
declarePrivate
(
'getScriptValue
Lis
t'
)
def
getScriptValue
Lis
t
(
self
):
security
.
declarePrivate
(
'getScriptValue
Dic
t'
)
def
getScriptValue
Dic
t
(
self
):
scripts
=
{}
for
script
in
self
.
objectValues
(
portal_type
=
'Workflow Script'
):
scripts
[
script
.
getReference
()]
=
script
return
scripts
security
.
declarePrivate
(
'getTransitionValue
Lis
t'
)
def
getTransitionValue
Lis
t
(
self
):
security
.
declarePrivate
(
'getTransitionValue
Dic
t'
)
def
getTransitionValue
Dic
t
(
self
):
interaction_dict
=
{}
for
tdef
in
self
.
objectValues
(
portal_type
=
"Interaction"
):
interaction_dict
[
tdef
.
getReference
()]
=
tdef
...
...
product/ERP5Workflow/Document/Workflow.py
View file @
f387101b
...
...
@@ -359,7 +359,7 @@ class Workflow(IdAsReferenceMixin("", "prefix"), XMLObject):
security_manager
=
getSecurityManager
()
workflow_id
=
self
.
getId
()
workflow_title
=
self
.
getTitle
()
for
worklist_id
,
worklist_definition
in
self
.
getWorklistValue
Lis
t
().
items
():
for
worklist_id
,
worklist_definition
in
self
.
getWorklistValue
Dic
t
().
items
():
action_box_name
=
worklist_definition
.
getActboxName
()
guard
=
worklist_definition
.
getGuard
()
if
action_box_name
:
...
...
@@ -502,7 +502,7 @@ class Workflow(IdAsReferenceMixin("", "prefix"), XMLObject):
id_list
.
append
(
ob
.
getReference
())
return
id_list
def
getWorklistValue
Lis
t
(
self
):
def
getWorklistValue
Dic
t
(
self
):
worklist_dict
=
{}
for
qdef
in
self
.
objectValues
(
portal_type
=
"Worklist"
):
worklist_dict
[
qdef
.
getReference
()]
=
qdef
...
...
@@ -514,7 +514,7 @@ class Workflow(IdAsReferenceMixin("", "prefix"), XMLObject):
id_list
.
append
(
ob
.
getReference
())
return
id_list
def
getTransitionValue
Lis
t
(
self
):
def
getTransitionValue
Dic
t
(
self
):
transition_dict
=
{}
for
tdef
in
self
.
objectValues
(
portal_type
=
"Transition"
):
transition_dict
[
tdef
.
getReference
()]
=
tdef
...
...
@@ -526,7 +526,7 @@ class Workflow(IdAsReferenceMixin("", "prefix"), XMLObject):
id_list
.
append
(
ob
.
getReference
())
return
id_list
def
getScriptValue
Lis
t
(
self
):
def
getScriptValue
Dic
t
(
self
):
scripts
=
{}
for
script
in
self
.
objectValues
(
portal_type
=
'Workflow Script'
):
scripts
[
script
.
getReference
()]
=
script
...
...
@@ -741,7 +741,7 @@ class Workflow(IdAsReferenceMixin("", "prefix"), XMLObject):
raise
WorkflowException
,
'Object is in an undefined state'
if
method_id
not
in
sdef
.
getTransitionIdList
():
raise
Unauthorized
(
method_id
)
tdef
=
self
.
getTransitionValue
Lis
t
().
get
(
method_id
,
None
)
tdef
=
self
.
getTransitionValue
Dic
t
().
get
(
method_id
,
None
)
if
tdef
is
None
or
tdef
.
getTriggerType
()
!=
TRIGGER_WORKFLOW_METHOD
:
raise
WorkflowException
,
(
'Transition %s is not triggered by a workflow method'
...
...
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