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
Lukas Niegsch
erp5
Commits
1cc48658
Commit
1cc48658
authored
Aug 02, 2015
by
wenjie.zheng
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Debugging FunctionalCore and FunctionalKM errors.
parent
aac83e25
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
11 additions
and
11 deletions
+11
-11
product/ERP5/Tool/WorkflowTool.py
product/ERP5/Tool/WorkflowTool.py
+5
-5
product/ERP5Type/Base.py
product/ERP5Type/Base.py
+5
-5
product/ERP5Type/ERP5Type.py
product/ERP5Type/ERP5Type.py
+1
-1
No files found.
product/ERP5/Tool/WorkflowTool.py
View file @
1cc48658
...
@@ -128,7 +128,7 @@ class WorkflowTool(BaseTool, OriginalWorkflowTool):
...
@@ -128,7 +128,7 @@ class WorkflowTool(BaseTool, OriginalWorkflowTool):
"""
"""
from
Products.ERP5.InteractionWorkflow
import
InteractionWorkflowDefinition
from
Products.ERP5.InteractionWorkflow
import
InteractionWorkflowDefinition
from
Products.ERP5Workflow.Document.InteractionWorkflow
import
InteractionWorkflow
from
Products.ERP5Workflow.Document.InteractionWorkflow
import
InteractionWorkflow
workflow_list
=
self
.
getWorkflow
s
For
(
ob
.
getPortalType
())
workflow_list
=
self
.
getWorkflow
ValueList
For
(
ob
.
getPortalType
())
if
wf_id
is
None
:
if
wf_id
is
None
:
if
not
workflow_list
:
if
not
workflow_list
:
raise
WorkflowException
(
'No workflows found.'
)
raise
WorkflowException
(
'No workflows found.'
)
...
@@ -155,7 +155,7 @@ class WorkflowTool(BaseTool, OriginalWorkflowTool):
...
@@ -155,7 +155,7 @@ class WorkflowTool(BaseTool, OriginalWorkflowTool):
"""
"""
from
Products.ERP5.InteractionWorkflow
import
InteractionWorkflowDefinition
from
Products.ERP5.InteractionWorkflow
import
InteractionWorkflowDefinition
from
Products.ERP5Workflow.Document.InteractionWorkflow
import
InteractionWorkflow
from
Products.ERP5Workflow.Document.InteractionWorkflow
import
InteractionWorkflow
for
workflow
in
(
wf_id
and
(
self
[
wf_id
],)
or
self
.
getWorkflow
s
For
(
ob
.
getPortalType
())):
for
workflow
in
(
wf_id
and
(
self
[
wf_id
],)
or
self
.
getWorkflow
ValueList
For
(
ob
.
getPortalType
())):
if
not
isinstance
(
workflow
,
InteractionWorkflowDefinition
)
and
\
if
not
isinstance
(
workflow
,
InteractionWorkflowDefinition
)
and
\
not
isinstance
(
workflow
,
InteractionWorkflow
):
not
isinstance
(
workflow
,
InteractionWorkflow
):
if
state_id
in
workflow
.
getStateIdList
():
if
state_id
in
workflow
.
getStateIdList
():
...
@@ -163,7 +163,7 @@ class WorkflowTool(BaseTool, OriginalWorkflowTool):
...
@@ -163,7 +163,7 @@ class WorkflowTool(BaseTool, OriginalWorkflowTool):
return
False
return
False
def
doActionFor
(
self
,
ob
,
action
,
wf_id
=
None
,
*
args
,
**
kw
):
def
doActionFor
(
self
,
ob
,
action
,
wf_id
=
None
,
*
args
,
**
kw
):
workflow_list
=
self
.
getWorkflow
s
For
(
ob
.
getPortalType
())
workflow_list
=
self
.
getWorkflow
ValueList
For
(
ob
.
getPortalType
())
action_ref
=
action
action_ref
=
action
if
wf_id
is
None
:
if
wf_id
is
None
:
if
workflow_list
==
[]:
if
workflow_list
==
[]:
...
@@ -214,7 +214,7 @@ class WorkflowTool(BaseTool, OriginalWorkflowTool):
...
@@ -214,7 +214,7 @@ class WorkflowTool(BaseTool, OriginalWorkflowTool):
workflow_list
.
append
(
wf
)
workflow_list
.
append
(
wf
)
return
workflow_list
return
workflow_list
getWorkflowsFor
=
getWorkflowValueListFor
#
getWorkflowsFor = getWorkflowValueListFor
def
getHistoryOf
(
self
,
wf_id
,
ob
):
def
getHistoryOf
(
self
,
wf_id
,
ob
):
""" Get the history of an object for a given workflow.
""" Get the history of an object for a given workflow.
...
@@ -529,7 +529,7 @@ class WorkflowTool(BaseTool, OriginalWorkflowTool):
...
@@ -529,7 +529,7 @@ class WorkflowTool(BaseTool, OriginalWorkflowTool):
def
isTransitionPossible
(
self
,
ob
,
transition_id
,
wf_id
=
None
):
def
isTransitionPossible
(
self
,
ob
,
transition_id
,
wf_id
=
None
):
"""Test if the given transition exist from the current state.
"""Test if the given transition exist from the current state.
"""
"""
for
workflow
in
(
wf_id
and
(
self
[
wf_id
],)
or
self
.
getWorkflow
s
For
(
ob
.
getPortalType
())):
for
workflow
in
(
wf_id
and
(
self
[
wf_id
],)
or
self
.
getWorkflow
ValueList
For
(
ob
.
getPortalType
())):
state
=
workflow
.
_getWorkflowStateOf
(
ob
)
state
=
workflow
.
_getWorkflowStateOf
(
ob
)
if
state
and
transition_id
in
state
.
getDestinationReferenceList
():
if
state
and
transition_id
in
state
.
getDestinationReferenceList
():
return
1
return
1
...
...
product/ERP5Type/Base.py
View file @
1cc48658
...
@@ -507,7 +507,7 @@ def initializePortalTypeDynamicWorkflowMethods(ptype_klass, portal_workflow):
...
@@ -507,7 +507,7 @@ def initializePortalTypeDynamicWorkflowMethods(ptype_klass, portal_workflow):
workflow_dict
=
{}
workflow_dict
=
{}
interaction_workflow_dict
=
{}
interaction_workflow_dict
=
{}
for
wf
in
portal_workflow
.
getWorkflow
s
For
(
portal_type
):
for
wf
in
portal_workflow
.
getWorkflow
ValueList
For
(
portal_type
):
wf_id
=
wf
.
getId
()
wf_id
=
wf
.
getId
()
wf_type
=
wf
.
__class__
.
__name__
wf_type
=
wf
.
__class__
.
__name__
if
wf_type
==
"DCWorkflowDefinition"
or
wf_type
==
"Workflow"
:
if
wf_type
==
"DCWorkflowDefinition"
or
wf_type
==
"Workflow"
:
...
@@ -2687,7 +2687,7 @@ class Base( CopyContainer,
...
@@ -2687,7 +2687,7 @@ class Base( CopyContainer,
'isDeleted'
)
'isDeleted'
)
def
isDeleted
(
self
):
def
isDeleted
(
self
):
"""Test if the context is in 'deleted' state"""
"""Test if the context is in 'deleted' state"""
for
wf
in
self
.
getPortalObject
().
portal_workflow
.
getWorkflow
s
For
(
self
):
for
wf
in
self
.
getPortalObject
().
portal_workflow
.
getWorkflow
ValueList
For
(
self
):
state
=
wf
.
_getWorkflowStateOf
(
self
)
state
=
wf
.
_getWorkflowStateOf
(
self
)
if
state
is
not
None
and
state
.
getReference
()
==
'deleted'
:
if
state
is
not
None
and
state
.
getReference
()
==
'deleted'
:
return
True
return
True
...
@@ -2729,7 +2729,7 @@ class Base( CopyContainer,
...
@@ -2729,7 +2729,7 @@ class Base( CopyContainer,
Returns a list of tuples {id:workflow_id, state:workflow_state}
Returns a list of tuples {id:workflow_id, state:workflow_state}
"""
"""
result
=
[]
result
=
[]
for
wf
in
self
.
portal_workflow
.
getWorkflow
s
For
(
self
.
getPortalType
()):
for
wf
in
self
.
portal_workflow
.
getWorkflow
ValueList
For
(
self
.
getPortalType
()):
result
+=
[(
wf
.
getReference
(),
wf
.
_getWorkflowStateOf
(
self
,
id_only
=
1
))]
result
+=
[(
wf
.
getReference
(),
wf
.
_getWorkflowStateOf
(
self
,
id_only
=
1
))]
return
result
return
result
...
@@ -3097,7 +3097,7 @@ class Base( CopyContainer,
...
@@ -3097,7 +3097,7 @@ class Base( CopyContainer,
# Check if edit_workflow defined
# Check if edit_workflow defined
portal_workflow
=
self
.
getPortalObject
().
portal_workflow
portal_workflow
=
self
.
getPortalObject
().
portal_workflow
wf
=
portal_workflow
.
getWorkflowById
(
'edit_workflow'
)
wf
=
portal_workflow
.
getWorkflowById
(
'edit_workflow'
)
wf_list
=
portal_workflow
.
getWorkflow
s
For
(
self
)
wf_list
=
portal_workflow
.
getWorkflow
ValueList
For
(
self
)
if
wf
is
not
None
:
if
wf
is
not
None
:
wf_list
=
[
wf
]
+
wf_list
wf_list
=
[
wf
]
+
wf_list
for
wf
in
wf_list
:
for
wf
in
wf_list
:
...
@@ -3372,7 +3372,7 @@ class Base( CopyContainer,
...
@@ -3372,7 +3372,7 @@ class Base( CopyContainer,
portal
=
self
.
getPortalObject
()
portal
=
self
.
getPortalObject
()
workflow_tool
=
portal
.
portal_workflow
workflow_tool
=
portal
.
portal_workflow
worflow_variable_list
=
[]
worflow_variable_list
=
[]
for
workflow
in
workflow_tool
.
getWorkflow
s
For
(
self
):
for
workflow
in
workflow_tool
.
getWorkflow
ValueList
For
(
self
):
if
not
isinstance
(
workflow
,
InteractionWorkflowDefinition
)
and
\
if
not
isinstance
(
workflow
,
InteractionWorkflowDefinition
)
and
\
not
isinstance
(
workflow
,
InteractionWorkflow
):
not
isinstance
(
workflow
,
InteractionWorkflow
):
worflow_variable_list
.
append
(
self
.
getProperty
(
workflow
.
getStateVariable
()))
worflow_variable_list
.
append
(
self
.
getProperty
(
workflow
.
getStateVariable
()))
...
...
product/ERP5Type/ERP5Type.py
View file @
1cc48658
...
@@ -427,7 +427,7 @@ class ERP5TypeInformation(XMLObject,
...
@@ -427,7 +427,7 @@ class ERP5TypeInformation(XMLObject,
# Unauthorized error on transition's condition
# Unauthorized error on transition's condition
workflow_tool
=
portal
.
portal_workflow
workflow_tool
=
portal
.
portal_workflow
if
workflow_tool
is
not
None
:
if
workflow_tool
is
not
None
:
for
workflow
in
workflow_tool
.
getWorkflow
s
For
(
ob
):
for
workflow
in
workflow_tool
.
getWorkflow
ValueList
For
(
ob
):
workflow
.
notifyCreated
(
ob
)
workflow
.
notifyCreated
(
ob
)
if
not
temp_object
:
if
not
temp_object
:
...
...
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