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
30f2582a
Commit
30f2582a
authored
Jun 27, 2016
by
iv
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ERP5Workflow: remove method doing accessor's job
parent
303bb9fc
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
19 additions
and
19 deletions
+19
-19
bt5/erp5_workflow/SkinTemplateItem/portal_skins/erp5_workflow/reassign_workflow_please.xml
...m/portal_skins/erp5_workflow/reassign_workflow_please.xml
+1
-1
product/ERP5/Interactor/PortalTypeClassInteractor.py
product/ERP5/Interactor/PortalTypeClassInteractor.py
+0
-4
product/ERP5Type/ERP5Type.py
product/ERP5Type/ERP5Type.py
+0
-8
product/ERP5Workflow/Tool/WorkflowTool.py
product/ERP5Workflow/Tool/WorkflowTool.py
+18
-6
No files found.
bt5/erp5_workflow/SkinTemplateItem/portal_skins/erp5_workflow/reassign_workflow_please.xml
View file @
30f2582a
...
...
@@ -70,7 +70,7 @@ for ptype_id in type_workflow_dict:\n
# 2. assign ERP5 Workflow to portal type:\n
type_workflow_list = ptype.getTypeWorkflowList()\n
if workflow_id not in type_workflow_list:\n
ptype.
addTypeWorkflowList(workflow_id
)\n
ptype.
setTypeWorkflowList(ptype.getTypeWorkflowList() + [workflow_id]
)\n
</string>
</value>
</item>
<item>
...
...
product/ERP5/Interactor/PortalTypeClassInteractor.py
View file @
30f2582a
...
...
@@ -56,10 +56,6 @@ class PortalTypeClassInteractor(Interactor):
self
.
on
(
Localizer
.
del_language
).
doAfter
(
self
.
resetDynamic
)
# New workflow compatibility
from
Products.ERP5Type.ERP5Type
import
ERP5TypeInformation
self
.
on
(
ERP5TypeInformation
.
addTypeWorkflowList
).
doAfter
(
self
.
resetDynamic
)
self
.
on
(
ERP5TypeInformation
.
_edit
).
doAfter
(
self
.
resetDynamic
)
from
Products.ERP5Workflow.Document.Workflow
import
Workflow
self
.
on
(
Workflow
.
_delObject
).
doAfter
(
self
.
resetDynamic
)
self
.
on
(
Workflow
.
_edit
).
doAfter
(
self
.
resetDynamic
)
...
...
product/ERP5Type/ERP5Type.py
View file @
30f2582a
...
...
@@ -451,14 +451,6 @@ class ERP5TypeInformation(XMLObject,
"""Getter for 'type_workflow' property"""
return
list
(
self
.
workflow_list
)
def
delTypeWorkflowList
(
self
,
wf_id
):
""" allow to modify workflow assignment from script. """
self
.
workflow_list
=
tuple
(
wf
for
wf
in
self
.
workflow_list
if
wf
!=
wf_id
)
def
addTypeWorkflowList
(
self
,
wf_id
):
""" allow to modify workflow assignment from script. """
self
.
workflow_list
=
self
.
workflow_list
+
(
wf_id
,
)
def
getTypePropertySheetValueList
(
self
):
type_property_sheet_list
=
self
.
getTypePropertySheetList
()
if
not
type_property_sheet_list
:
...
...
product/ERP5Workflow/Tool/WorkflowTool.py
View file @
30f2582a
...
...
@@ -567,14 +567,18 @@ class WorkflowTool(BaseTool, OriginalWorkflowTool):
# type-workflow reassignment
type_workflow_dict
=
self
.
getChainsByType
()
type_tool
=
self
.
getPortalObject
().
portal_types
for
ptype_id
in
type_workflow_dict
:
ptype
=
type_tool
.
_getOb
(
ptype_id
,
None
)
if
ptype
is
not
None
and
workflow_id
in
type_workflow_dict
[
ptype_id
]:
# 1. clean DC workflow assignement:
self
.
delTypeCBT
(
ptype_id
,
workflow_id
)
# 2. assign ERP5 Workflow to portal type:
if
workflow_id
not
in
ptype
.
getTypeWorkflowList
():
ptype
.
addTypeWorkflowList
(
workflow_id
)
type_workflow_list
=
ptype
.
getTypeWorkflowList
()
if
workflow_id
not
in
workflow_list
:
ptype
.
setTypeWorkflowList
(
type_workflow_list
+
[
workflow_id
]
)
def
reassignWorkflowWithoutConversion
(
self
):
# This function should be called when a new template installed and add
...
...
@@ -587,6 +591,7 @@ class WorkflowTool(BaseTool, OriginalWorkflowTool):
# be done, just go back to whatever you are doing.
type_workflow_dict
=
self
.
getChainsByType
()
type_tool
=
self
.
getPortalObject
().
portal_types
erp5_workflow_list
=
[]
for
ptype_id
in
type_workflow_dict
:
ptype
=
type_tool
.
_getOb
(
ptype_id
,
None
)
if
ptype
is
not
None
:
...
...
@@ -598,8 +603,9 @@ class WorkflowTool(BaseTool, OriginalWorkflowTool):
# 2. assign ERP5 Workflow to portal type:
type_workflow_list
=
ptype
.
getTypeWorkflowList
()
if
workflow_id
not
in
type_workflow_list
:
ptype
.
addTypeWorkflowList
(
workflow_id
)
ptype
.
setTypeWorkflowList
(
type_workflow_list
+
[
workflow_id
]
)
def
getChainDict
(
self
):
chain_dict
=
{}
for
portal_type
,
wf_id_list
in
self
.
_chains_by_type
.
iteritems
():
...
...
@@ -975,13 +981,19 @@ class WorkflowTool(BaseTool, OriginalWorkflowTool):
def
addWorkflowToType
(
self
,
type_value
,
wf_id_list
):
# assign workflow(s) to a type
dc_wf_id_list
=
[]
erp5_wf_id_list
=
[]
for
wf_id
in
wf_id_list
:
wf_value
=
self
.
_getOb
(
wf_id
)
if
self
.
_getOb
(
wf_id
).
__class__
.
__name__
in
(
'DCWorkflowDefinition'
,
'InteractionWorkflowDefinition'
):
dc_wf_id_list
.
append
(
wf_id
)
else
:
type_value
.
addTypeWorkflowList
(
wf_id
)
if
dc_wf_id_list
!=
[]:
erp5_wf_id_list
.
append
(
wf_id
)
if
erp5_wf_id_list
:
type_value
.
setTypeWorkflowList
(
type_value
.
getTypeWorkflowList
()
+
erp5_wf_id_list
)
if
dc_wf_id_list
:
self
.
setChainForPortalTypes
([
type_value
.
id
],
tuple
(
dc_wf_id_list
))
InitializeClass
(
WorkflowTool
)
...
...
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