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
Labels
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
Romain Courteaud
erp5
Commits
61cf42d8
Commit
61cf42d8
authored
3 years ago
by
Arnaud Fontaine
Committed by
Romain Courteaud
3 years ago
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
WIP
parent
72382477
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
44 additions
and
4 deletions
+44
-4
bt5/erp5_configurator/DocumentTemplateItem/portal_components/document.erp5.BusinessConfiguration.py
.../portal_components/document.erp5.BusinessConfiguration.py
+16
-0
product/ERP5/Tool/CategoryTool.py
product/ERP5/Tool/CategoryTool.py
+12
-0
product/ERP5Type/ERP5Type.py
product/ERP5Type/ERP5Type.py
+3
-0
product/ERP5Type/Tool/PropertySheetTool.py
product/ERP5Type/Tool/PropertySheetTool.py
+1
-1
product/ERP5Type/Tool/TypesTool.py
product/ERP5Type/Tool/TypesTool.py
+7
-1
product/ERP5Type/dynamic/portal_type_class.py
product/ERP5Type/dynamic/portal_type_class.py
+2
-1
product/ERP5Type/patches/DCWorkflow.py
product/ERP5Type/patches/DCWorkflow.py
+2
-1
product/ERP5Type/patches/WorkflowTool.py
product/ERP5Type/patches/WorkflowTool.py
+1
-0
No files found.
bt5/erp5_configurator/DocumentTemplateItem/portal_components/document.erp5.BusinessConfiguration.py
View file @
61cf42d8
...
...
@@ -43,6 +43,21 @@ END_STATE_TITLE = 'End'
## TODO-ERP5Workflow: Initially part of Workflow implementation done for
## ERP5Configurator but not used by ERP5 Workflow...
def
initializeDocument
(
workflow
,
document
):
"""
Set initial state on the Document
"""
state_bc_id
=
workflow
.
getStateBaseCategory
()
document
.
setCategoryMembership
(
state_bc_id
,
workflow
.
getSource
())
object
=
workflow
.
getStateChangeInformation
(
document
,
workflow
.
getSourceValue
())
# Initialize workflow history
status_dict
=
{
state_bc_id
:
workflow
.
getSource
()}
variable_list
=
workflow
.
contentValues
(
portal_type
=
'Workflow Variable'
)
for
variable
in
variable_list
:
status_dict
[
variable
.
getTitle
()]
=
variable
.
getVariableValue
(
object
=
object
)
workflow
.
_updateWorkflowHistory
(
document
,
status_dict
)
def
_generateHistoryKey
(
workflow
):
"""
Generate a key used in the workflow history.
...
...
@@ -330,6 +345,7 @@ class BusinessConfiguration(Item):
next_state
=
self
.
unrestrictedTraverse
(
transition
.
getDestination
())
for
wh
in
getWorkflowHistory
(
current_state
,
self
):
if
next_state
==
self
.
unrestrictedTraverse
(
wh
[
'current_state'
]):
import
pdb
;
pdb
.
set_trace
()
configuration_save
=
self
.
unrestrictedTraverse
(
wh
[
'configuration_save_url'
])
return
configuration_save
...
...
This diff is collapsed.
Click to expand it.
product/ERP5/Tool/CategoryTool.py
View file @
61cf42d8
...
...
@@ -62,6 +62,18 @@ class CategoryTool(CMFCategoryTool, BaseTool):
objectValues
=
BaseTool
.
objectValues
def
_isBootstrapRequired
(
self
):
return
'before_script'
not
in
self
def
_bootstrap
(
self
):
from
Products.ERP5.ERP5Site
import
ERP5Generator
ERP5Generator
.
bootstrap
(
self
,
'erp5_core'
,
'CategoryTemplateItem'
,
(
'before_script'
,
'before_commit_script'
,
'activate_script'
,
'after_script'
,
))
# Filter content (ZMI))
def
filtered_meta_types
(
self
,
user
=
None
):
# Filters the list of available meta types.
...
...
This diff is collapsed.
Click to expand it.
product/ERP5Type/ERP5Type.py
View file @
61cf42d8
...
...
@@ -497,6 +497,9 @@ class ERP5TypeInformation(XMLObject,
"""Getter for 'type_workflow' property"""
return
list
(
self
.
workflow_list
)
def
_setTypeWorkflowList
(
self
,
type_workflow_list
):
self
.
workflow_list
=
type_workflow_list
security
.
declareProtected
(
Permissions
.
ModifyPortalContent
,
'setTypeWorkflowList'
)
def
setTypeWorkflowList
(
self
,
type_workflow_list
):
...
...
This diff is collapsed.
Click to expand it.
product/ERP5Type/Tool/PropertySheetTool.py
View file @
61cf42d8
...
...
@@ -67,7 +67,7 @@ class PropertySheetTool(BaseTool):
'template_tool_component_id_property'
)
def
_isBootstrapRequired
(
self
):
if
not
self
.
has_key
(
'
BaseType
'
):
if
not
self
.
has_key
(
'
Interaction
'
):
return
True
bt_has_key
=
self
.
BusinessTemplate
.
has_key
...
...
This diff is collapsed.
Click to expand it.
product/ERP5Type/Tool/TypesTool.py
View file @
61cf42d8
...
...
@@ -101,7 +101,7 @@ class TypesTool(TypeProvider):
security
.
declareObjectProtected
(
Permissions
.
AccessContentsInformation
)
def
_isBootstrapRequired
(
self
):
if
not
self
.
has_key
(
'
Standard Property
'
):
if
not
self
.
has_key
(
'
Interaction Workflow
'
):
return
True
# bootstrap is not required, but we may have a few bugfixes to apply
# so that the user can upgrade Business Templates
...
...
@@ -133,7 +133,11 @@ class TypesTool(TypeProvider):
'Standard Property'
,
'Acquired Property'
,
# workflow (initializePortalTypeDynamicWorkflowMethods)
'State'
,
'Transition'
,
'Workflow Script'
,
'Workflow Variable'
,
'Worklist'
,
'Workflow'
,
'Interaction'
,
'Interaction Workflow'
,
...
...
@@ -143,6 +147,8 @@ class TypesTool(TypeProvider):
'Catalog Tool'
,
))
ERP5Generator
.
bootstrap_allow_type
(
self
,
'Catalog Tool'
)
ERP5Generator
.
bootstrap_allow_type
(
self
,
'Workflow'
)
ERP5Generator
.
bootstrap_allow_type
(
self
,
'Interaction Workflow'
)
def
listContentTypes
(
self
,
container
=
None
):
"""List content types from all providers
...
...
This diff is collapsed.
Click to expand it.
product/ERP5Type/dynamic/portal_type_class.py
View file @
61cf42d8
...
...
@@ -434,10 +434,11 @@ def synchronizeDynamicModules(context, force=False):
from
Products.ERP5Type.Tool.PropertySheetTool
import
PropertySheetTool
from
Products.ERP5Type.Tool.TypesTool
import
TypesTool
from
Products.ERP5Type.Tool.ComponentTool
import
ComponentTool
from
Products.ERP5.Tool.CategoryTool
import
CategoryTool
from
Products.ERP5Type.Tool.WorkflowTool
import
WorkflowTool
from
Products.ERP5Catalog.Tool.ERP5CatalogTool
import
ERP5CatalogTool
try
:
for
tool_class
in
TypesTool
,
PropertySheetTool
,
ComponentTool
,
ERP5CatalogTool
,
WorkflowTool
:
for
tool_class
in
TypesTool
,
PropertySheetTool
,
ComponentTool
,
ERP5CatalogTool
,
CategoryTool
,
WorkflowTool
:
# if the instance has no property sheet tool, or incomplete
# property sheets, we need to import some data to bootstrap
# (only likely to happen on the first run ever)
...
...
This diff is collapsed.
Click to expand it.
product/ERP5Type/patches/DCWorkflow.py
View file @
61cf42d8
...
...
@@ -1229,7 +1229,8 @@ def convertToERP5Workflow(self, temp_object=False):
trash_tool
=
getattr
(
portal
,
'portal_trash'
,
None
)
if
trash_tool
is
not
None
:
# move old workflow to trash tool;
LOG
(
" | Move old workflow '%s' into a trash bin"
,
0
,
self
.
id
)
LOG
(
"convertToERP5Workflow"
,
0
,
"Move old workflow '%s' into a trash bin"
%
self
.
id
)
workflow_tool
.
_delOb
(
self
.
id
)
from
Products.ERP5Type.UnrestrictedMethod
import
UnrestrictedMethod
trashbin
=
UnrestrictedMethod
(
trash_tool
.
newTrashBin
)(
self
.
id
)
...
...
This diff is collapsed.
Click to expand it.
product/ERP5Type/patches/WorkflowTool.py
View file @
61cf42d8
...
...
@@ -205,6 +205,7 @@ def WorkflowTool_bootstrap(self):
WorkflowTool
.
_isBootstrapRequired
=
WorkflowTool_isBootstrapRequired
WorkflowTool
.
_bootstrap
=
WorkflowTool_bootstrap
WorkflowTool
.
getWorkflowValueListFor
=
WorkflowTool
.
getWorkflowsFor
def
_deleteChainsByType
(
self
,
pt
,
wf_id
):
self
.
_chains_by_type
[
pt
]
=
tuple
(
wf
for
wf
in
self
.
_chains_by_type
[
pt
]
if
wf
!=
wf_id
)
...
...
This diff is collapsed.
Click to expand it.
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