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
Matevz Golob
erp5
Commits
869a3cea
Commit
869a3cea
authored
Jan 27, 2017
by
Ayush Tiwari
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bt5_protoype: Update migration function for BT5 to BP5
parent
00699185
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
7 deletions
+10
-7
product/ERP5/Tool/TemplateTool.py
product/ERP5/Tool/TemplateTool.py
+10
-7
No files found.
product/ERP5/Tool/TemplateTool.py
View file @
869a3cea
...
...
@@ -575,12 +575,14 @@ class TemplateTool (BaseTool):
export_dir = mkdtemp()
installed_bt_list = self.
objectValues
()
installed_bt_list = self.
getInstalledBusinessTemplatesList
()
installed_bt_title_list = [bt.title for bt in installed_bt_list]
is_installed = False
if import_template.getTitle() not in installed_bt_title_list:
# Install the business template
import_template.install(**kw)
is_installed = True
# Make list of object paths which needs to be added in the bp5
# This can be decided by looping over every type of items we do have in
...
...
@@ -644,16 +646,15 @@ class TemplateTool (BaseTool):
catalog_method_item_list
=
import_template
.
getTemplateCatalogMethodIdList
()
catalog_method_path_list
=
[]
for
method
in
catalog_method_item_list
:
catalog_method_path_list
.
append
(
'portal_catalog'
+
method
)
catalog_method_path_list
.
append
(
'portal_catalog
/
'
+
method
)
template_path_list
.
extend
(
catalog_method_path_list
)
# For catalog objects, we check if there is any catalog object, and then
# add
portal_catalog/erp5_mysql_innodb
in the path if there is
# add
catalog object also
in the path if there is
template_catalog_datetime_key
=
import_template
.
getTemplateCatalogDatetimeKeyList
()
template_catalog_full_text_key
=
import_template
.
getTemplateCatalogFullTextKeyList
()
template_catalog_keyword_key
=
import_template
.
getTemplateCatalogKeywordKeyList
()
template_catalog_local_role_key
=
import_template
.
getTemplateCatalogLocalRoleKeyList
()
template_catalog_method_id
=
import_template
.
getTemplateCatalogMethodIdList
()
template_catalog_multivalue_key
=
import_template
.
getTemplateCatalogMultivalueKeyList
()
template_catalog_related_key
=
import_template
.
getTemplateCatalogRelatedKeyList
()
template_catalog_request_key
=
import_template
.
getTemplateCatalogRequestKeyList
()
...
...
@@ -676,10 +677,12 @@ class TemplateTool (BaseTool):
# Create new objects for business package
bp5_package
=
self
.
newContent
(
portal_type
=
'Business Package'
)
bp5_package
.
edit
(
template_path_list
)
bp5_package
.
build
(
self
)
bp5_package
.
edit
(
template_path_list
=
template_path_list
)
bp5_package
.
build
()
# Export the newly built business package to the export directory
bp5_package
.
export
(
path
=
export_dir
)
bp5_package
.
export
(
path
=
export_dir
,
local
=
True
)
if
is_installed
:
import_package
.
uninstall
()
security
.
declareProtected
(
'Import/Export objects'
,
'migrateBTListToBP'
)
def
migrateBTListToBP
(
self
,
repository_list
,
REQUEST
=
None
,
**
kw
):
...
...
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