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
Aurélien Vermylen
erp5
Commits
2b4e93d5
Commit
2b4e93d5
authored
Aug 16, 2017
by
Ayush Tiwari
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bt5_config: Break updateInstallation State function to 2 functions which install and compare states
parent
e6c52c24
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
54 additions
and
1 deletion
+54
-1
product/ERP5/Tool/TemplateTool.py
product/ERP5/Tool/TemplateTool.py
+54
-1
No files found.
product/ERP5/Tool/TemplateTool.py
View file @
2b4e93d5
...
@@ -1913,7 +1913,7 @@ class TemplateTool (BaseTool):
...
@@ -1913,7 +1913,7 @@ class TemplateTool (BaseTool):
security
.
declareProtected
(
Permissions
.
ManagePortal
,
security
.
declareProtected
(
Permissions
.
ManagePortal
,
'updateInstallationState'
)
'updateInstallationState'
)
def
updat
eInstallationState
(
self
,
bm_list
):
def
compar
eInstallationState
(
self
,
bm_list
):
"""
"""
Run installation after comparing combined Business Manager status
Run installation after comparing combined Business Manager status
...
@@ -2059,8 +2059,61 @@ class TemplateTool (BaseTool):
...
@@ -2059,8 +2059,61 @@ class TemplateTool (BaseTool):
return
change_list
return
change_list
def
updateInstallationState
(
self
,
bm_list
,
force
=
1
):
"""
First compare installation state and then install the final value
"""
change_list
=
self
.
compareInstallationState
(
bm_list
)
if
force
:
to_install_path_list
=
[
l
[
0
]
for
l
in
change_list
]
to_install_path_list
=
self
.
sortPathList
(
to_install_path_list
)
# Install the path items with bm_list as context
self
.
installBusinessItemList
(
bm_list
,
to_install_path_list
)
installMultipleBusinessManager
=
updateInstallationState
installMultipleBusinessManager
=
updateInstallationState
def
installBusinessItemList
(
self
,
manager_list
,
item_path_list
):
"""
Install Business Item/Business Property Item from the current Installation
Process given the change_list which carries the list of paths to be
installed
"""
LOG
(
'INFO'
,
0
,
'%s'
%
[
item_path_list
])
# Create BM for new installation state and update its path item list
new_installation_state
=
self
.
newContent
(
portal_type
=
'Business Manager'
,
title
=
'Final Installation State'
,
temp_object
=
True
,
)
combined_new_path_item_list
=
[
item
for
bm
in
manager_list
for
item
in
bm
.
objectValues
()]
for
item
in
combined_new_path_item_list
:
item
.
isIndexable
=
ConstantGetter
(
'isIndexable'
,
value
=
False
)
new_id
=
new_installation_state
.
generateNewId
()
new_installation_state
.
_setObject
(
new_id
,
aq_base
(
item
),
suppress_events
=
True
)
for
path
in
item_path_list
:
item
=
new_installation_state
.
getBusinessItemByPath
(
path
)
if
item
is
None
:
raise
ValueError
(
"Couldn't find path in current Installation State"
)
item
.
install
(
new_installation_state
)
# Update workflow history of the installed Business Manager(s)
# Get the 'business_manager_installation_workflow' as it is already
# bootstrapped and installed
portal_workflow
=
self
.
getPortalObject
().
portal_workflow
wf
=
portal_workflow
.
_getOb
(
'business_manager_installation_workflow'
)
# Change the installation state for all the BM(s) in manager_list.
for
manager
in
manager_list
:
wf
.
_executeMetaTransition
(
manager
,
'installed'
)
def
calculateComparableHash
(
self
,
object
,
isProperty
=
False
):
def
calculateComparableHash
(
self
,
object
,
isProperty
=
False
):
"""
"""
Remove some attributes before comparing hashses
Remove some attributes before comparing hashses
...
...
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