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
Nikola Balog
erp5
Commits
2339a5ef
Commit
2339a5ef
authored
Feb 23, 2017
by
Ayush Tiwari
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bt5_config: Add combine function for multiple BM in template tool
parent
eb73e563
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
10 deletions
+17
-10
product/ERP5/Tool/TemplateTool.py
product/ERP5/Tool/TemplateTool.py
+17
-10
No files found.
product/ERP5/Tool/TemplateTool.py
View file @
2339a5ef
...
@@ -1637,31 +1637,38 @@ class TemplateTool (BaseTool):
...
@@ -1637,31 +1637,38 @@ class TemplateTool (BaseTool):
final_prop_item
.
install
()
final_prop_item
.
install
()
security
.
declareProtected
(
Permissions
.
ManagePortal
,
security
.
declareProtected
(
Permissions
.
ManagePortal
,
'
install
MultipleBusinessManager'
)
'
combine
MultipleBusinessManager'
)
def
install
MultipleBusinessManager
(
self
,
bm_list
):
def
combine
MultipleBusinessManager
(
self
,
bm_list
):
"""
"""
Creates a single BM from multiple Business Manager and run installation
Combines multiple BM to form single flattened BM
on all at once after reducing the final BM.
"""
"""
# Create the final Business Manager
# Create the final Business Manager
if
len
(
bm_list
)
==
1
:
if
len
(
bm_list
)
==
1
:
combinedB
T
=
bm_list
[
0
]
combinedB
M
=
bm_list
[
0
]
else
:
else
:
# Summation should also consider arithmetic on the Business Item(s)
# Summation should also consider arithmetic on the Business Item(s)
# having same path and layer and combine them.
# having same path and layer and combine them.
combinedB
T
=
sum
(
bm_list
)
combinedB
M
=
sum
(
bm_list
)
# XXX: We are missing the part of creating installed_BM for all the BM
# XXX: We are missing the part of creating installed_BM for all the BM
# we have in bm_list, because this would be needed in case we build
# we have in bm_list, because this would be needed in case we build
# Business Manager again
# Business Manager again
# Reduce the final Business Manager
# Reduce the final Business Manager
combinedBT
.
reduceBusinessManager
()
combinedBM
.
reduceBusinessManager
()
combinedBT
.
flattenBusinessManager
()
combinedBM
.
flattenBusinessManager
()
return
combinedBM
if
combinedBT
.
getStatus
()
==
'flattened'
:
security
.
declareProtected
(
Permissions
.
ManagePortal
,
'installMultipleBusinessManager'
)
def
installMultipleBusinessManager
(
self
,
bm
):
"""
Run installation on flattened Business Manager
"""
if
bm
.
getStatus
()
==
'flattened'
:
# Run install on separate Business Item one by one
# Run install on separate Business Item one by one
for
path_item
in
combinedBT
.
_path_item_list
:
for
path_item
in
bm
.
_path_item_list
:
path_item
.
install
(
self
)
path_item
.
install
(
self
)
else
:
else
:
raise
ValueError
,
'Business Manager not flattened, cannot install'
raise
ValueError
,
'Business Manager not flattened, cannot install'
...
...
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