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
Lukas Niegsch
erp5
Commits
56b8bc8b
Commit
56b8bc8b
authored
Apr 28, 2015
by
wenjie.zheng
Committed by
Sebastien Robin
Jul 16, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ERP5Site.py: modify portal_workflow migration function, add workflow_module migration function.
parent
ad705410
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
31 additions
and
13 deletions
+31
-13
product/ERP5/ERP5Site.py
product/ERP5/ERP5Site.py
+15
-13
product/ERP5Type/id_as_reference.py
product/ERP5Type/id_as_reference.py
+16
-0
No files found.
product/ERP5/ERP5Site.py
View file @
56b8bc8b
...
...
@@ -1644,26 +1644,28 @@ class ERP5Site(FolderMixIn, CMFSite, CacheCookieMixin):
""" manually called function to migrate dcworkflow to erp5workflow.
only for the specific case of workflow migration.
"""
if
hasattr
(
self
,
'portal_workflow_old'
):
tool
=
self
.
portal_workflow_old
tool
=
self
.
portal_workflow
object_id_list
=
tool
.
objectIds
()
object_clipboard
=
tool
.
manage_copyObjects
(
object_id_list
)
new_tool
=
self
.
newContent
(
id
=
'portal_workflow_new'
,
portal_type
=
'ERP5 Workflow Tool'
)
LOG
(
' ERP5Site.py'
,
WARNING
,
' create %s '
%
new_tool
.
id
)
new_tool
.
manage_pasteObjects
(
object_clipboard
)
new_tool
.
_chains_by_type
=
tool
.
_chains_by_type
LOG
(
' ERP5Site.py'
,
WARNING
,
' copy objects to %s from %s.'
%
(
new_tool
.
id
,
tool
.
id
))
if
hasattr
(
self
,
'portal_workflow_old'
):
self
.
manage_delObjects
([
'portal_workflow'
])
else
:
self
.
manage_renameObject
(
tool
.
id
,
'portal_workflow_old'
)
self
.
manage_delObjects
([
'portal_workflow'
])
self
.
manage_renameObject
(
new_tool
.
id
,
'portal_workflow'
)
security
.
declareProtected
(
Permissions
.
ManagePortal
,
'migrateWorkflowModuleToPortalWorkflow'
)
def
migrateWorkflowModuleToPortalWorkflow
(
self
):
""" manually called function to migrate dcworkflow to erp5workflow.
only for the specific case of workflow migration.
"""
tool
=
self
.
workflow_module
object_id_list
=
tool
.
objectIds
()
new_tool
=
self
.
portal_workflow
object_clipboard
=
tool
.
manage_copyObjects
(
object_id_list
)
new_tool
=
self
.
portal_workflow
new_tool
.
manage_pasteObjects
(
object_clipboard
)
self
.
manage_renameObject
(
new_tool
.
id
,
'portal_workflow'
)
Globals
.
InitializeClass
(
ERP5Site
)
...
...
product/ERP5Type/id_as_reference.py
View file @
56b8bc8b
...
...
@@ -50,6 +50,22 @@ def IdAsReferenceMixin(suffix):
def
getIdAsReferenceSuffix
():
return
suffix
def
__migrate
(
self
):
if
self
.
id
[
suffix_index
:]
!=
suffix
:
new_id
=
self
.
__dict__
.
get
(
'default_reference'
)
+
suffix
parent
=
self
.
getParentValue
()
if
parent
.
has_key
(
new_id
):
LOG
(
"IdAsReferenceMixin"
,
WARNING
,
"Skipping migration of %r in %r"
" property sheet, due to ID conflict"
%
(
new_id
,
parent
.
getId
()))
else
:
try
:
self
.
setId
(
new_id
)
del
self
.
default_reference
except
ActivityPendingError
:
LOG
(
"IdAsReferenceMixin"
,
WARNING
,
"Skipping migration of %r in %r"
" property sheet, due to pending activities"
%
(
new_id
,
parent
.
getId
()))
security
.
declareProtected
(
Permissions
.
AccessContentsInformation
,
'getReference'
)
def
getReference
(
self
,
*
args
):
...
...
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