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
635bb7c1
Commit
635bb7c1
authored
Jul 22, 2016
by
iv
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ERP5Workflow: start moving type-workflow association from chain_dict to portal_types
parent
43492f4c
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
22 deletions
+18
-22
product/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/ERP5Site_updateTranslationTable.py
...portal_skins/erp5_core/ERP5Site_updateTranslationTable.py
+0
-3
product/ERP5Workflow/Tool/WorkflowTool.py
product/ERP5Workflow/Tool/WorkflowTool.py
+18
-19
No files found.
product/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/ERP5Site_updateTranslationTable.py
View file @
635bb7c1
...
@@ -20,12 +20,9 @@ def catalog_translation_list(object_list):
...
@@ -20,12 +20,9 @@ def catalog_translation_list(object_list):
object_list
=
[]
object_list
=
[]
portal_workflow
=
context
.
portal_workflow
portal_workflow
=
context
.
portal_workflow
portal_type_list
=
context
.
portal_types
.
objectValues
()
portal_type_list
=
context
.
portal_types
.
objectValues
()
chain_dict
=
portal_workflow
.
getChainsByType
()
for
portal_type
in
portal_type_list
:
for
portal_type
in
portal_type_list
:
associated_workflow_id_list
=
[]
associated_workflow_id_list
=
[]
associated_workflow_id_list
.
extend
(
portal_type
.
getTypeWorkflowList
())
associated_workflow_id_list
.
extend
(
portal_type
.
getTypeWorkflowList
())
if
portal_type
.
id
in
chain_dict
:
associated_workflow_id_list
.
extend
(
list
(
chain_dict
[
portal_type
.
id
]))
for
wf_id
in
associated_workflow_id_list
:
for
wf_id
in
associated_workflow_id_list
:
wf
=
getattr
(
context
.
portal_workflow
,
wf_id
,
None
)
wf
=
getattr
(
context
.
portal_workflow
,
wf_id
,
None
)
if
wf
is
None
:
if
wf
is
None
:
...
...
product/ERP5Workflow/Tool/WorkflowTool.py
View file @
635bb7c1
...
@@ -81,7 +81,7 @@ from webdav.client import Resource
...
@@ -81,7 +81,7 @@ from webdav.client import Resource
from
zLOG
import
LOG
,
INFO
,
WARNING
from
zLOG
import
LOG
,
INFO
,
WARNING
"""
"""
Most of the code
s in this file are copy-pasted
from patches/WorkflowTool.py.
Most of the code
in this file has been taken
from patches/WorkflowTool.py.
"""
"""
_marker
=
[]
# Create a new marker object.
_marker
=
[]
# Create a new marker object.
...
@@ -115,6 +115,7 @@ class WorkflowTool(BaseTool, OriginalWorkflowTool):
...
@@ -115,6 +115,7 @@ class WorkflowTool(BaseTool, OriginalWorkflowTool):
_manage_selectWorkflows
=
OriginalWorkflowTool
.
_manage_selectWorkflows
_manage_selectWorkflows
=
OriginalWorkflowTool
.
_manage_selectWorkflows
manage_selectWorkflows
=
OriginalWorkflowTool
.
manage_selectWorkflows
manage_selectWorkflows
=
OriginalWorkflowTool
.
manage_selectWorkflows
manage_changeWorkflows
=
OriginalWorkflowTool
.
manage_changeWorkflows
manage_changeWorkflows
=
OriginalWorkflowTool
.
manage_changeWorkflows
# Declarative properties
# Declarative properties
property_sheets
=
(
property_sheets
=
(
PropertySheet
.
Base
,
PropertySheet
.
Base
,
...
@@ -377,8 +378,7 @@ class WorkflowTool(BaseTool, OriginalWorkflowTool):
...
@@ -377,8 +378,7 @@ class WorkflowTool(BaseTool, OriginalWorkflowTool):
state_path
=
'destination/'
+
'/'
.
join
(
state
.
getPath
().
split
(
'/'
)[
2
:])
state_path
=
'destination/'
+
'/'
.
join
(
state
.
getPath
().
split
(
'/'
)[
2
:])
tdef
.
setCategoryList
([
state_path
])
tdef
.
setCategoryList
([
state_path
])
# worklists (portal_type = Worklist)
# worklists (portal_type = Worklist)
for
qid
in
dc_workflow
.
worklists
:
for
qid
,
qdef
in
dc_workflow
.
worklists
.
items
():
qdef
=
dc_workflow
.
worklists
.
get
(
qid
)
worklist
=
workflow
.
newContent
(
portal_type
=
'Worklist'
,
temp_object
=
is_temporary
)
worklist
=
workflow
.
newContent
(
portal_type
=
'Worklist'
,
temp_object
=
is_temporary
)
worklist
.
setTitle
(
qdef
.
title
)
worklist
.
setTitle
(
qdef
.
title
)
worklist
.
setReference
(
qdef
.
id
)
worklist
.
setReference
(
qdef
.
id
)
...
@@ -410,7 +410,7 @@ class WorkflowTool(BaseTool, OriginalWorkflowTool):
...
@@ -410,7 +410,7 @@ class WorkflowTool(BaseTool, OriginalWorkflowTool):
if
isinstance
(
values
,
Expression
):
if
isinstance
(
values
,
Expression
):
worklist_variable_value
.
setVariableExpression
(
values
.
text
)
worklist_variable_value
.
setVariableExpression
(
values
.
text
)
else
:
else
:
worklist_variable_value
.
setVariableValue
(
values
[
0
])
#to be changed
worklist_variable_value
.
setVariableValue
(
values
[
0
])
#to be changed
?
worklist
.
setActboxUrl
(
qdef
.
actbox_url
)
worklist
.
setActboxUrl
(
qdef
.
actbox_url
)
worklist
.
setActboxCategory
(
qdef
.
actbox_category
)
worklist
.
setActboxCategory
(
qdef
.
actbox_category
)
...
@@ -565,15 +565,15 @@ class WorkflowTool(BaseTool, OriginalWorkflowTool):
...
@@ -565,15 +565,15 @@ class WorkflowTool(BaseTool, OriginalWorkflowTool):
type_workflow_dict
=
self
.
getChainsByType
()
type_workflow_dict
=
self
.
getChainsByType
()
type_tool
=
self
.
getPortalObject
().
portal_types
type_tool
=
self
.
getPortalObject
().
portal_types
for
ptype_id
in
type_workflow_dict
:
for
p
ortal_
type_id
in
type_workflow_dict
:
p
type
=
type_tool
.
_getOb
(
p
type_id
,
None
)
p
ortal_type
=
type_tool
.
_getOb
(
portal_
type_id
,
None
)
if
p
type
is
not
None
and
workflow_id
in
type_workflow_dict
[
p
type_id
]:
if
p
ortal_type
is
not
None
and
workflow_id
in
type_workflow_dict
[
portal_
type_id
]:
# 1. clean DC workflow assignement:
# 1. clean DC workflow assignement:
self
.
delTypeCBT
(
ptype_id
,
workflow_id
)
self
.
delTypeCBT
(
p
ortal_
type_id
,
workflow_id
)
# 2. assign ERP5 Workflow to portal type:
# 2. assign ERP5 Workflow to portal type:
type_workflow_list
=
ptype
.
getTypeWorkflowList
()
type_workflow_list
=
p
ortal_
type
.
getTypeWorkflowList
()
if
workflow_id
not
in
type_workflow_list
:
if
workflow_id
not
in
type_workflow_list
:
ptype
.
setTypeWorkflowList
(
p
ortal_
type
.
setTypeWorkflowList
(
type_workflow_list
+
[
workflow_id
]
type_workflow_list
+
[
workflow_id
]
)
)
...
@@ -588,19 +588,18 @@ class WorkflowTool(BaseTool, OriginalWorkflowTool):
...
@@ -588,19 +588,18 @@ class WorkflowTool(BaseTool, OriginalWorkflowTool):
# be done, just go back to whatever you are doing.
# be done, just go back to whatever you are doing.
type_workflow_dict
=
self
.
getChainsByType
()
type_workflow_dict
=
self
.
getChainsByType
()
type_tool
=
self
.
getPortalObject
().
portal_types
type_tool
=
self
.
getPortalObject
().
portal_types
erp5_workflow_list
=
[]
for
portal_type_id
in
type_workflow_dict
:
for
ptype_id
in
type_workflow_dict
:
portal_type
=
type_tool
.
_getOb
(
portal_type_id
,
None
)
ptype
=
type_tool
.
_getOb
(
ptype_id
,
None
)
if
portal_type
is
not
None
:
if
ptype
is
not
None
:
for
workflow_id
in
type_workflow_dict
[
portal_type_id
]:
for
workflow_id
in
type_workflow_dict
[
ptype_id
]:
workflow
=
getattr
(
self
,
workflow_id
,
None
)
workflow
=
getattr
(
self
,
workflow_id
,
None
)
if
workflow
and
workflow
.
getPortalType
()
in
[
'Workflow'
,
'Interaction Workflow'
]:
if
workflow
and
workflow
.
getPortalType
()
in
[
'Workflow'
,
'Interaction Workflow'
,
'DCWorkflowDefinition'
,
'InteractionWorkflowDefinition'
]:
# 1. clean DC workflow assignement:
# 1. clean DC workflow assignement:
self
.
delTypeCBT
(
ptype
.
id
,
workflow
.
id
)
self
.
delTypeCBT
(
p
ortal_
type
.
id
,
workflow
.
id
)
# 2. assign ERP5 Workflow to portal type:
# 2. assign ERP5 Workflow to portal type:
type_workflow_list
=
ptype
.
getTypeWorkflowList
()
type_workflow_list
=
p
ortal_
type
.
getTypeWorkflowList
()
if
workflow_id
not
in
type_workflow_list
:
if
workflow_id
not
in
type_workflow_list
:
ptype
.
setTypeWorkflowList
(
p
ortal_
type
.
setTypeWorkflowList
(
type_workflow_list
+
[
workflow_id
]
type_workflow_list
+
[
workflow_id
]
)
)
def
getChainDict
(
self
):
def
getChainDict
(
self
):
...
...
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