Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
E
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
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Ayush Tiwari
erp5
Commits
16ddf1cd
Commit
16ddf1cd
authored
Sep 19, 2017
by
Ayush Tiwari
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bt5_config: Add migrateBTToBM to be used with migration dialog for TemplateTool
parent
95f13d53
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
15 deletions
+15
-15
product/ERP5/Tool/TemplateTool.py
product/ERP5/Tool/TemplateTool.py
+15
-15
No files found.
product/ERP5/Tool/TemplateTool.py
View file @
16ddf1cd
...
@@ -971,35 +971,35 @@ class TemplateTool (BaseTool):
...
@@ -971,35 +971,35 @@ class TemplateTool (BaseTool):
return
a2
return
a2
security
.
declareProtected
(
'Import/Export objects'
,
'migrateBTListToBM'
)
security
.
declareProtected
(
'Import/Export objects'
,
'migrateBTListToBM'
)
def
migrateBT
ListToBM
(
self
,
repository
_list
,
REQUEST
=
None
,
**
kw
):
def
migrateBT
ToBMRequest
(
self
,
bt_title
_list
,
REQUEST
=
None
,
**
kw
):
"""
"""
Run migration for BT5 one by one in a given repository. This will be done
Run migration for BT5 one by one in a given repository. This will be done
via activities.
via activities.
"""
"""
repository_list
=
filter
(
bool
,
repository_list
)
if
REQUEST
is
None
:
if
REQUEST
is
None
:
REQUEST
=
getattr
(
self
,
'REQUEST'
,
None
)
REQUEST
=
getattr
(
self
,
'REQUEST'
,
None
)
if
len
(
repository
_list
)
==
0
and
REQUEST
:
if
len
(
bt_title
_list
)
==
0
and
REQUEST
:
ret_url
=
self
.
absolute_url
()
ret_url
=
self
.
absolute_url
()
REQUEST
.
RESPONSE
.
redirect
(
"%s?portal_status_message=%s"
REQUEST
.
RESPONSE
.
redirect
(
"%s?portal_status_message=%s"
%
(
ret_url
,
'No repository was defined'
))
%
(
ret_url
,
'No BT title was given'
))
for
repository
in
repository_list
:
repository_list
=
self
.
getRepositoryList
()
repository
=
repository
.
rstrip
(
'
\
n
'
)
for
title
in
bt_title_list
:
repository
=
repository
.
rstrip
(
'
\
r
'
)
title
=
title
.
rstrip
(
'
\
n
'
)
for
business_template_id
in
os
.
listdir
(
repository
):
title
=
title
.
rstrip
(
'
\
r
'
)
template_path
=
os
.
path
.
join
(
repository
,
business_template_id
)
for
repository
in
repository_list
:
if
title
in
os
.
listdir
(
repository
):
template_path
=
os
.
path
.
join
(
repository
,
title
)
else
:
continue
if
os
.
path
.
isfile
(
template_path
):
if
os
.
path
.
isfile
(
template_path
):
LOG
(
business_template_id
,
0
,
'is file, so it is skipped'
)
LOG
(
title
,
0
,
'is file, so it is skipped'
)
else
:
else
:
if
not
os
.
path
.
exists
((
os
.
path
.
join
(
template_path
,
'bt'
))):
if
not
os
.
path
.
exists
((
os
.
path
.
join
(
template_path
,
'bt'
))):
LOG
(
business_template_id
,
0
,
'has no bt sub-folder, so it is skipped'
)
LOG
(
title
,
0
,
'has no bt sub-folder, so it is skipped'
)
else
:
else
:
self
.
migrateBTToBM
(
template_path
)
self
.
migrateBTToBM
(
template_path
)
#self.activate(activity='SQLQueue').\
# migrateBTToBP(template_path)
security
.
declareProtected
(
Permissions
.
ManagePortal
,
'getFilteredDiff'
)
security
.
declareProtected
(
Permissions
.
ManagePortal
,
'getFilteredDiff'
)
def
getFilteredDiff
(
self
,
diff
):
def
getFilteredDiff
(
self
,
diff
):
...
...
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