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
Noah Brackenbury
erp5
Commits
4301bf87
Commit
4301bf87
authored
Mar 06, 2017
by
Ayush Tiwari
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bt5_config: Do not flatten Business Manager
parent
b6e0d3b5
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
6 deletions
+15
-6
product/ERP5/Tool/TemplateTool.py
product/ERP5/Tool/TemplateTool.py
+15
-6
No files found.
product/ERP5/Tool/TemplateTool.py
View file @
4301bf87
...
...
@@ -1654,13 +1654,20 @@ class TemplateTool (BaseTool):
"""
Combines multiple BM to form single flattened BM
"""
new_bm_list
=
bm_list
[:]
# Create the final Business Manager
if
len
(
bm_list
)
==
1
:
combinedBM
=
bm_list
[
0
]
combinedBM
=
new_
bm_list
[
0
]
else
:
# Better to create a new Business Manager than to make change
# in the installed one
combinedBM
=
self
.
newContent
(
portal_type
=
'Business Manager'
)
combinedBM
.
build
()
# Summation should also consider arithmetic on the Business Item(s)
# having same path and layer and combine them.
combinedBM
=
reduce
(
lambda
x
,
y
:
x
+
y
,
bm_list
)
new_bm_list
.
insert
(
0
,
combinedBM
)
combinedBM
=
reduce
(
lambda
x
,
y
:
x
+
y
,
new_bm_list
)
# 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
...
...
@@ -1668,7 +1675,7 @@ class TemplateTool (BaseTool):
# Reduce the final Business Manager
combinedBM
.
reduceBusinessManager
()
combinedBM
.
flattenBusinessManager
()
#
combinedBM.flattenBusinessManager()
return
combinedBM
...
...
@@ -1678,8 +1685,9 @@ class TemplateTool (BaseTool):
"""
Run installation on flattened Business Manager
"""
if
bm
.
getStatus
()
==
'
flatten
ed'
:
if
bm
.
getStatus
()
==
'
reduc
ed'
:
# Run install on separate Business Item one by one
import
pdb
;
pdb
.
set_trace
()
for
path_item
in
bm
.
_path_item_list
:
path_item
.
install
(
self
)
else
:
...
...
@@ -1695,10 +1703,10 @@ class TemplateTool (BaseTool):
installed_bm_list
=
self
.
getInstalledBusinessManagerList
()
installed_bm_title_list
=
self
.
getInstalledBusinessManagerTitleList
()
installed_bm_dict
=
dict
(
zip
(
installed_bm_title_list
,
installed_bm_list
))
for
bm
in
bm_list
:
if
bm
.
title
in
installed_bm_title_list
:
# Not very suitable way to look for already installed BM
installed_bm
=
installed_bm_dict
[
bm
.
title
]
# XXX: Installed BM is already reduced. For the Business Manager we
...
...
@@ -1708,6 +1716,7 @@ class TemplateTool (BaseTool):
else
:
final_bm_list
.
append
(
bm
)
combinedBM
=
self
.
combineMultipleBusinessManager
(
final_bm_list
)
self
.
installBusinessManager
(
combinedBM
)
...
...
@@ -1732,7 +1741,7 @@ class TemplateTool (BaseTool):
def
compareBusinessManager
(
self
,
new_bm
,
old_bm
):
"""
Compare two business manager and return a new Business manager based on
the difference. This is specially required to com
ap
re two versions of
the difference. This is specially required to com
pa
re two versions of
Business Manager(s).
"""
compared_bm
=
new_bm
-
old_bm
...
...
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