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
Gabriel Monnerat
erp5
Commits
670e7553
Commit
670e7553
authored
Oct 21, 2022
by
Kazuhiko Shiozaki
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
workflow: import InteractionWorkflowDefinition only if WITH_LEGACY_WORKFLOW is True.
parent
8d5a3ce4
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
3 deletions
+13
-3
product/ERP5Type/Base.py
product/ERP5Type/Base.py
+5
-1
product/ERP5Type/Tool/WorkflowTool.py
product/ERP5Type/Tool/WorkflowTool.py
+8
-2
No files found.
product/ERP5Type/Base.py
View file @
670e7553
...
@@ -3534,7 +3534,11 @@ class Base(
...
@@ -3534,7 +3534,11 @@ class Base(
# Use meta transition to jump from one state to another
# Use meta transition to jump from one state to another
# without existing transitions.
# without existing transitions.
from
Products.ERP5Type
import
WITH_LEGACY_WORKFLOW
if
WITH_LEGACY_WORKFLOW
:
from
Products.ERP5.InteractionWorkflow
import
InteractionWorkflowDefinition
from
Products.ERP5.InteractionWorkflow
import
InteractionWorkflowDefinition
else
:
InteractionWorkflowDefinition
=
None
.
__class__
from
Products.ERP5Type.Core.InteractionWorkflow
import
InteractionWorkflow
from
Products.ERP5Type.Core.InteractionWorkflow
import
InteractionWorkflow
portal
=
self
.
getPortalObject
()
portal
=
self
.
getPortalObject
()
workflow_tool
=
portal
.
portal_workflow
workflow_tool
=
portal
.
portal_workflow
...
...
product/ERP5Type/Tool/WorkflowTool.py
View file @
670e7553
...
@@ -98,7 +98,10 @@ class WorkflowTool(BaseTool, OriginalWorkflowTool):
...
@@ -98,7 +98,10 @@ class WorkflowTool(BaseTool, OriginalWorkflowTool):
This is public method to allow passing meta transition (Jump form
This is public method to allow passing meta transition (Jump form
any state to another in same workflow)
any state to another in same workflow)
"""
"""
if
WITH_LEGACY_WORKFLOW
:
from
Products.ERP5.InteractionWorkflow
import
InteractionWorkflowDefinition
from
Products.ERP5.InteractionWorkflow
import
InteractionWorkflowDefinition
else
:
InteractionWorkflowDefinition
=
None
.
__class__
from
Products.ERP5Type.Core.InteractionWorkflow
import
InteractionWorkflow
from
Products.ERP5Type.Core.InteractionWorkflow
import
InteractionWorkflow
workflow_list
=
self
.
getWorkflowValueListFor
(
ob
.
getPortalType
())
workflow_list
=
self
.
getWorkflowValueListFor
(
ob
.
getPortalType
())
if
wf_id
is
None
:
if
wf_id
is
None
:
...
@@ -124,7 +127,10 @@ class WorkflowTool(BaseTool, OriginalWorkflowTool):
...
@@ -124,7 +127,10 @@ class WorkflowTool(BaseTool, OriginalWorkflowTool):
"""Test if given state_id is available for ob
"""Test if given state_id is available for ob
in at least one associated workflow
in at least one associated workflow
"""
"""
if
WITH_LEGACY_WORKFLOW
:
from
Products.ERP5.InteractionWorkflow
import
InteractionWorkflowDefinition
from
Products.ERP5.InteractionWorkflow
import
InteractionWorkflowDefinition
else
:
InteractionWorkflowDefinition
=
None
.
__class__
from
Products.ERP5Type.Core.InteractionWorkflow
import
InteractionWorkflow
from
Products.ERP5Type.Core.InteractionWorkflow
import
InteractionWorkflow
for
workflow
in
(
wf_id
and
(
self
[
wf_id
],)
or
self
.
getWorkflowValueListFor
(
ob
.
getPortalType
())):
for
workflow
in
(
wf_id
and
(
self
[
wf_id
],)
or
self
.
getWorkflowValueListFor
(
ob
.
getPortalType
())):
if
not
isinstance
(
workflow
,
(
InteractionWorkflowDefinition
,
if
not
isinstance
(
workflow
,
(
InteractionWorkflowDefinition
,
...
...
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