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
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Frederic Thoma
erp5
Commits
c50c76a4
Commit
c50c76a4
authored
Mar 26, 2021
by
Arnaud Fontaine
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
WIP
parent
b6ababa1
Changes
9
Show 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 @
c50c76a4
...
@@ -43,6 +43,21 @@ END_STATE_TITLE = 'End'
...
@@ -43,6 +43,21 @@ END_STATE_TITLE = 'End'
## TODO-ERP5Workflow: Initially part of Workflow implementation done for
## TODO-ERP5Workflow: Initially part of Workflow implementation done for
## ERP5Configurator but not used by ERP5 Workflow...
## 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
):
def
_generateHistoryKey
(
workflow
):
"""
"""
Generate a key used in the workflow history.
Generate a key used in the workflow history.
...
...
product/ERP5/Tool/CategoryTool.py
View file @
c50c76a4
...
@@ -62,6 +62,18 @@ class CategoryTool(CMFCategoryTool, BaseTool):
...
@@ -62,6 +62,18 @@ class CategoryTool(CMFCategoryTool, BaseTool):
objectValues
=
BaseTool
.
objectValues
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))
# Filter content (ZMI))
def
filtered_meta_types
(
self
,
user
=
None
):
def
filtered_meta_types
(
self
,
user
=
None
):
# Filters the list of available meta types.
# Filters the list of available meta types.
...
...
product/ERP5Type/ERP5Type.py
View file @
c50c76a4
...
@@ -497,6 +497,9 @@ class ERP5TypeInformation(XMLObject,
...
@@ -497,6 +497,9 @@ class ERP5TypeInformation(XMLObject,
"""Getter for 'type_workflow' property"""
"""Getter for 'type_workflow' property"""
return
list
(
self
.
workflow_list
)
return
list
(
self
.
workflow_list
)
def
_setTypeWorkflowList
(
self
,
type_workflow_list
):
self
.
workflow_list
=
type_workflow_list
security
.
declareProtected
(
Permissions
.
ModifyPortalContent
,
security
.
declareProtected
(
Permissions
.
ModifyPortalContent
,
'setTypeWorkflowList'
)
'setTypeWorkflowList'
)
def
setTypeWorkflowList
(
self
,
type_workflow_list
):
def
setTypeWorkflowList
(
self
,
type_workflow_list
):
...
...
product/ERP5Type/Tool/PropertySheetTool.py
View file @
c50c76a4
...
@@ -67,7 +67,7 @@ class PropertySheetTool(BaseTool):
...
@@ -67,7 +67,7 @@ class PropertySheetTool(BaseTool):
'template_tool_component_id_property'
)
'template_tool_component_id_property'
)
def
_isBootstrapRequired
(
self
):
def
_isBootstrapRequired
(
self
):
if
not
self
.
has_key
(
'
BaseType
'
):
if
not
self
.
has_key
(
'
Interaction
'
):
return
True
return
True
bt_has_key
=
self
.
BusinessTemplate
.
has_key
bt_has_key
=
self
.
BusinessTemplate
.
has_key
...
...
product/ERP5Type/Tool/TypesTool.py
View file @
c50c76a4
...
@@ -101,7 +101,7 @@ class TypesTool(TypeProvider):
...
@@ -101,7 +101,7 @@ class TypesTool(TypeProvider):
security
.
declareObjectProtected
(
Permissions
.
AccessContentsInformation
)
security
.
declareObjectProtected
(
Permissions
.
AccessContentsInformation
)
def
_isBootstrapRequired
(
self
):
def
_isBootstrapRequired
(
self
):
if
not
self
.
has_key
(
'
Standard Property
'
):
if
not
self
.
has_key
(
'
Interaction Workflow
'
):
return
True
return
True
# bootstrap is not required, but we may have a few bugfixes to apply
# bootstrap is not required, but we may have a few bugfixes to apply
# so that the user can upgrade Business Templates
# so that the user can upgrade Business Templates
...
@@ -133,7 +133,11 @@ class TypesTool(TypeProvider):
...
@@ -133,7 +133,11 @@ class TypesTool(TypeProvider):
'Standard Property'
,
'Standard Property'
,
'Acquired Property'
,
'Acquired Property'
,
# workflow (initializePortalTypeDynamicWorkflowMethods)
# workflow (initializePortalTypeDynamicWorkflowMethods)
'State'
,
'Transition'
,
'Transition'
,
'Workflow Script'
,
'Workflow Variable'
,
'Worklist'
,
'Workflow'
,
'Workflow'
,
'Interaction'
,
'Interaction'
,
'Interaction Workflow'
,
'Interaction Workflow'
,
...
@@ -143,6 +147,8 @@ class TypesTool(TypeProvider):
...
@@ -143,6 +147,8 @@ class TypesTool(TypeProvider):
'Catalog Tool'
,
'Catalog Tool'
,
))
))
ERP5Generator
.
bootstrap_allow_type
(
self
,
'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
):
def
listContentTypes
(
self
,
container
=
None
):
"""List content types from all providers
"""List content types from all providers
...
...
product/ERP5Type/dynamic/portal_type_class.py
View file @
c50c76a4
...
@@ -434,10 +434,11 @@ def synchronizeDynamicModules(context, force=False):
...
@@ -434,10 +434,11 @@ def synchronizeDynamicModules(context, force=False):
from
Products.ERP5Type.Tool.PropertySheetTool
import
PropertySheetTool
from
Products.ERP5Type.Tool.PropertySheetTool
import
PropertySheetTool
from
Products.ERP5Type.Tool.TypesTool
import
TypesTool
from
Products.ERP5Type.Tool.TypesTool
import
TypesTool
from
Products.ERP5Type.Tool.ComponentTool
import
ComponentTool
from
Products.ERP5Type.Tool.ComponentTool
import
ComponentTool
from
Products.ERP5.Tool.CategoryTool
import
CategoryTool
from
Products.ERP5Type.Tool.WorkflowTool
import
WorkflowTool
from
Products.ERP5Type.Tool.WorkflowTool
import
WorkflowTool
from
Products.ERP5Catalog.Tool.ERP5CatalogTool
import
ERP5CatalogTool
from
Products.ERP5Catalog.Tool.ERP5CatalogTool
import
ERP5CatalogTool
try
:
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
# if the instance has no property sheet tool, or incomplete
# property sheets, we need to import some data to bootstrap
# property sheets, we need to import some data to bootstrap
# (only likely to happen on the first run ever)
# (only likely to happen on the first run ever)
...
...
product/ERP5Type/patches/DCWorkflow.py
View file @
c50c76a4
...
@@ -1229,7 +1229,8 @@ def convertToERP5Workflow(self, temp_object=False):
...
@@ -1229,7 +1229,8 @@ def convertToERP5Workflow(self, temp_object=False):
trash_tool
=
getattr
(
portal
,
'portal_trash'
,
None
)
trash_tool
=
getattr
(
portal
,
'portal_trash'
,
None
)
if
trash_tool
is
not
None
:
if
trash_tool
is
not
None
:
# move old workflow to trash tool;
# 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
)
workflow_tool
.
_delOb
(
self
.
id
)
from
Products.ERP5Type.UnrestrictedMethod
import
UnrestrictedMethod
from
Products.ERP5Type.UnrestrictedMethod
import
UnrestrictedMethod
trashbin
=
UnrestrictedMethod
(
trash_tool
.
newTrashBin
)(
self
.
id
)
trashbin
=
UnrestrictedMethod
(
trash_tool
.
newTrashBin
)(
self
.
id
)
...
...
product/ERP5Type/patches/WorkflowTool.py
View file @
c50c76a4
...
@@ -205,6 +205,7 @@ def WorkflowTool_bootstrap(self):
...
@@ -205,6 +205,7 @@ def WorkflowTool_bootstrap(self):
WorkflowTool
.
_isBootstrapRequired
=
WorkflowTool_isBootstrapRequired
WorkflowTool
.
_isBootstrapRequired
=
WorkflowTool_isBootstrapRequired
WorkflowTool
.
_bootstrap
=
WorkflowTool_bootstrap
WorkflowTool
.
_bootstrap
=
WorkflowTool_bootstrap
WorkflowTool
.
getWorkflowValueListFor
=
WorkflowTool
.
getWorkflowsFor
def
_deleteChainsByType
(
self
,
pt
,
wf_id
):
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
)
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 @
c50c76a4
...
@@ -944,14 +944,6 @@ class ERP5TypeCommandLineTestCase(ERP5TypeTestCaseMixin):
...
@@ -944,14 +944,6 @@ class ERP5TypeCommandLineTestCase(ERP5TypeTestCaseMixin):
light_install
=
self
.
enableLightInstall
()
light_install
=
self
.
enableLightInstall
()
create_activities
=
self
.
enableActivityTool
()
create_activities
=
self
.
enableActivityTool
()
hot_reindexing
=
self
.
enableHotReindexing
()
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
,
self
.
setUpERP5Site
(
business_template_list
=
template_list
,
light_install
=
light_install
,
light_install
=
light_install
,
create_activities
=
create_activities
,
create_activities
=
create_activities
,
...
@@ -1274,9 +1266,8 @@ class ERP5TypeCommandLineTestCase(ERP5TypeTestCaseMixin):
...
@@ -1274,9 +1266,8 @@ class ERP5TypeCommandLineTestCase(ERP5TypeTestCaseMixin):
self
.
dynamicWorkflowConversion
()
self
.
dynamicWorkflowConversion
()
portal
.
portal_types
.
resetDynamicDocumentsOnceAtTransactionBoundary
()
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
)
self
.
tic
(
not
quiet
)
# Log out
# Log out
if
not
quiet
:
if
not
quiet
:
ZopeTestCase
.
_print
(
'Logout ...
\
n
'
)
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