Commit a9b300ce authored by Ayush Tiwari's avatar Ayush Tiwari

bt5_config: Add preinstall function to compare the status while installing Business Manager

parent 4476163e
...@@ -264,6 +264,28 @@ class BusinessManager(Folder): ...@@ -264,6 +264,28 @@ class BusinessManager(Folder):
item.setProperty('item_property_value', '') item.setProperty('item_property_value', '')
item.setProperty('item_property_type', '') item.setProperty('item_property_type', '')
security.declareProtected(Permissions.ManagePortal, 'preinstall')
def preinstall(self, check_dependencies=1, **kw):
"""
Preinstall for Business Manager comapres the installation state and returns
the changes in a manner which can keep up compatibilty with the view we use
in Business Template installation.
This function calls `portal_templates.updateInstallationState` to get the
change_list.
We don't care of check_dependencies here as this all would be taken care by
`udpateInstallationState` iteself.
"""
change_list = self.aq_parent.compareInstallationState([self])
modified_object_list = {}
for path in change_list:
type_name = 'Business Item'
if '#' in path[0]:
type_name = 'Business Property Item'
modified_object_list[path[0]] = [path[1], type_name]
return modified_object_list
security.declareProtected(Permissions.ManagePortal, 'clean') security.declareProtected(Permissions.ManagePortal, 'clean')
clean = _clean clean = _clean
...@@ -501,9 +523,6 @@ class BusinessManager(Folder): ...@@ -501,9 +523,6 @@ class BusinessManager(Folder):
""" """
pass pass
def preinstall(self, check_dependencies=1, **kw):
pass
def reduceBusinessManager(self): def reduceBusinessManager(self):
""" """
Reduction is a function that takes a Business Manager as input and returns Reduction is a function that takes a Business Manager as input and returns
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment