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
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Hardik Juneja
erp5
Commits
94b4d388
Commit
94b4d388
authored
Jun 02, 2015
by
wenjie.zheng
Committed by
Sebastien Robin
Jul 16, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ERP5Site.py: deploy new workflow tool type Workflow Tool to replace ERP5 Workflow Tool.
parent
83e6e9af
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
11 deletions
+6
-11
product/ERP5/ERP5Site.py
product/ERP5/ERP5Site.py
+6
-11
No files found.
product/ERP5/ERP5Site.py
View file @
94b4d388
...
...
@@ -45,7 +45,7 @@ import os
import
warnings
import
transaction
from
App.config
import
getConfiguration
from
Products.ERP5.Tool.
ERP5WorkflowTool
import
ERP5
WorkflowTool
from
Products.ERP5.Tool.
WorkflowTool
import
WorkflowTool
from
zope.lifecycleevent
import
ObjectCopiedEvent
from
OFS.event
import
ObjectClonedEvent
from
zope.event
import
notify
...
...
@@ -1647,27 +1647,22 @@ class ERP5Site(FolderMixIn, CMFSite, CacheCookieMixin):
can only be executed after install bt erp5_workflow.
"""
tool
=
self
.
portal_workflow
if
tool
.
getPortalType
()
!=
'
ERP5
Workflow Tool'
:
if
tool
.
getPortalType
()
!=
'Workflow Tool'
:
# create new
ERP5
Workflow Tool
self
.
_setObject
(
'portal_workflow_new'
,
ERP5
WorkflowTool
())
# create new Workflow Tool
self
.
_setObject
(
'portal_workflow_new'
,
WorkflowTool
())
new_tool
=
getattr
(
self
,
'portal_workflow_new'
)
new_tool
.
_chains_by_type
=
tool
.
_chains_by_type
# copy-paste operation
for
id
in
tool
.
objectIds
():
ob
=
tool
.
_getOb
(
id
)
orig_id
=
ob
.
getId
()
ob
.
_notifyOfCopyTo
(
new_tool
,
op
=
0
)
orig_ob
=
ob
ob
=
ob
.
_getCopy
(
new_tool
)
ob
=
ob
.
_getCopy
(
tool
)
ob
.
_setId
(
id
)
notify
(
ObjectCopiedEvent
(
ob
,
orig_ob
))
new_tool
.
_setObject
(
id
,
ob
)
ob
=
new_tool
.
_getOb
(
id
)
ob
.
wl_clearLocks
()
ob
.
_postCopy
(
new_tool
,
op
=
0
)
notify
(
ObjectClonedEvent
(
ob
)
)
ob
.
wl_clearLocks
(
)
# migration
self
.
portal_workflow
=
new_tool
...
...
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