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
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
Romain Courteaud
erp5
Commits
7139dc1e
Commit
7139dc1e
authored
Mar 26, 2021
by
Arnaud Fontaine
Committed by
Romain Courteaud
Mar 26, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
WIP
parent
ccdff868
Changes
9
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
44 additions
and
14 deletions
+44
-14
bt5/erp5_configurator/DocumentTemplateItem/portal_components/document.erp5.BusinessConfiguration.py
.../portal_components/document.erp5.BusinessConfiguration.py
+15
-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
product/ERP5Type/tests/ERP5TypeTestCase.py
product/ERP5Type/tests/ERP5TypeTestCase.py
+1
-10
No files found.
bt5/erp5_configurator/DocumentTemplateItem/portal_components/document.erp5.BusinessConfiguration.py
View file @
7139dc1e
...
...
@@ -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.
...
...
product/ERP5/Tool/CategoryTool.py
View file @
7139dc1e
...
...
@@ -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.
...
...
product/ERP5Type/ERP5Type.py
View file @
7139dc1e
...
...
@@ -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
):
...
...
product/ERP5Type/Tool/PropertySheetTool.py
View file @
7139dc1e
...
...
@@ -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
...
...
product/ERP5Type/Tool/TypesTool.py
View file @
7139dc1e
...
...
@@ -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
...
...
product/ERP5Type/dynamic/portal_type_class.py
View file @
7139dc1e
...
...
@@ -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)
...
...
product/ERP5Type/patches/DCWorkflow.py
View file @
7139dc1e
...
...
@@ -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
)
...
...
product/ERP5Type/patches/WorkflowTool.py
View file @
7139dc1e
...
...
@@ -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
)
...
...
product/ERP5Type/tests/ERP5TypeTestCase.py
View file @
7139dc1e
...
...
@@ -944,14 +944,6 @@ class ERP5TypeCommandLineTestCase(ERP5TypeTestCaseMixin):
light_install
=
self
.
enableLightInstall
()
create_activities
=
self
.
enableActivityTool
()
hot_reindexing
=
self
.
enableHotReindexing
()
for
x
,
y
in
((
"erp5_core_proxy_field_legacy"
,
"erp5_base"
),
(
"erp5_stock_cache"
,
"erp5_pdm"
)):
if
x
not
in
template_list
:
try
:
template_list
.
insert
(
template_list
.
index
(
y
),
x
)
except
ValueError
:
pass
self
.
setUpERP5Site
(
business_template_list
=
template_list
,
light_install
=
light_install
,
create_activities
=
create_activities
,
...
...
@@ -1274,9 +1266,8 @@ class ERP5TypeCommandLineTestCase(ERP5TypeTestCaseMixin):
self
.
dynamicWorkflowConversion
()
portal
.
portal_types
.
resetDynamicDocumentsOnceAtTransactionBoundary
()
self
.
getPortal
().
erp5_sql_connection
.
manage_test
(
"update message_queue set processing_node=0, priority=1 where processing_node=-1"
)
self
.
getPortal
().
erp5_sql_connection
.
manage_test
(
"update message set processing_node=0, priority=2 where processing_node=-1"
)
self
.
tic
(
not
quiet
)
# Log out
if
not
quiet
:
ZopeTestCase
.
_print
(
'Logout ...
\
n
'
)
...
...
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