Commit 84cea92a authored by Ayush Tiwari's avatar Ayush Tiwari

bt5_package: Add constructors to classes need for intialization

parent d6ffba49
......@@ -140,6 +140,22 @@ def _recursiveRemoveUid(obj):
_recursiveRemoveUid(subobj)
# New BusinessItem addition function
def manage_addBusinessItem(self, item_path='', item_sign=1, item_layer=0, *args, **kw):
# Create BusinessItem object container
c = BusinessItem(item_path, item_sign, item_layer)
return c
# New BusinessPropertyItem addition function
def manage_addBusinessPropertyItem(self, item_path='', item_sign=1, item_layer=0, *args, **kw):
# Create BusinessPathItem object container
c = BusinessPropertyItem(item_path, item_sign, item_layer)
return c
class BusinessManager(Folder):
"""Business Manager is responsible for saving objects and properties in
......@@ -597,9 +613,10 @@ class BusinessItem(XMLObject):
# Declarative security
security = ClassSecurityInfo()
security.declareObjectProtected(Permissions.AccessContentsInformation)
constructors = (manage_addBusinessItem,)
portal_type = 'Business Item'
meta_type = 'Business Item'
icon = None
isProperty = False
isIndexable = False
......@@ -902,8 +919,10 @@ class BusinessPropertyItem(XMLObject):
portal_type = 'Business Property Item'
meta_type = 'Business Property Item'
icon = None
isIndexable = False
isProperty = True
constructors = (manage_addBusinessPropertyItem,)
def _edit(self, item_path='', item_sign=1, item_layer=0, *args, **kw):
"""
......
......@@ -58,6 +58,7 @@ object_classes = ( ERP5Site.ERP5Site,
PythonScript.PythonScriptThroughZMI,
SQLMethod.SQLMethod,
BusinessManager.BusinessItem,
BusinessManager.BusinessPropertyItem,
)
portal_tools = ( CategoryTool.CategoryTool,
SimulationTool.SimulationTool,
......
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