Commit a8d7e9a1 authored by Ayush Tiwari's avatar Ayush Tiwari Committed by Ayush Tiwari

bt5_package: Add constructors to classes need for intialization

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