Commit a434a494 authored by Fabien Morin's avatar Fabien Morin

make possible to pass portal_type parameter to newCellContent method.

newCell method accept portal_type parameter and call newCellContent with passing it, but it was not used. Now it is.


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@27235 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent cfe42150
...@@ -446,11 +446,11 @@ class AssortedResource(TransformedResource): ...@@ -446,11 +446,11 @@ class AssortedResource(TransformedResource):
return result return result
security.declareProtected( Permissions.ModifyPortalContent, 'newCellContent' ) security.declareProtected( Permissions.ModifyPortalContent, 'newCellContent' )
def newCellContent(self, id,**kw): def newCellContent(self, id, portal_type='Set Mapped Value', **kw):
""" """
This method can be overriden This method can be overriden
""" """
self.invokeFactory(type_name="Set Mapped Value",id=id) self.invokeFactory(type_name=portal_type, id=id)
return self.get(id) return self.get(id)
security.declarePrivate('_checkConsistency') security.declarePrivate('_checkConsistency')
......
...@@ -71,11 +71,11 @@ class ContainerLine(DeliveryLine): ...@@ -71,11 +71,11 @@ class ContainerLine(DeliveryLine):
# Cell Related # Cell Related
security.declareProtected( Permissions.ModifyPortalContent, 'newCellContent' ) security.declareProtected( Permissions.ModifyPortalContent, 'newCellContent' )
def newCellContent(self, id,**kw): def newCellContent(self, id, portal_type='Container Cell', **kw):
""" """
This method can be overriden This method can be overriden
""" """
self.invokeFactory(type_name="Container Cell",id=id) self.invokeFactory(type_name=portal_type, id=id)
return self.get(id) return self.get(id)
security.declareProtected(Permissions.AccessContentsInformation, 'isAccountable') security.declareProtected(Permissions.AccessContentsInformation, 'isAccountable')
......
...@@ -74,11 +74,11 @@ class InvoiceLine(DeliveryLine): ...@@ -74,11 +74,11 @@ class InvoiceLine(DeliveryLine):
# Cell Related # Cell Related
security.declareProtected( Permissions.ModifyPortalContent, security.declareProtected( Permissions.ModifyPortalContent,
'newCellContent' ) 'newCellContent' )
def newCellContent(self, id,**kw): def newCellContent(self, id, portal_type='Invoice Cell', **kw):
""" """
This method can be overriden This method can be overriden
""" """
self.invokeFactory(type_name="Invoice Cell",id=id) self.invokeFactory(type_name=portal_type, id=id)
return self.get(id) return self.get(id)
security.declareProtected( Permissions.AccessContentsInformation, security.declareProtected( Permissions.AccessContentsInformation,
......
...@@ -236,11 +236,11 @@ class InvoiceTransactionRule(Rule, PredicateMatrix): ...@@ -236,11 +236,11 @@ class InvoiceTransactionRule(Rule, PredicateMatrix):
# Matrix related # Matrix related
security.declareProtected( Permissions.ModifyPortalContent, security.declareProtected( Permissions.ModifyPortalContent,
'newCellContent' ) 'newCellContent' )
def newCellContent(self, id, **kw): def newCellContent(self, id, portal_type='Accounting Rule Cell', **kw):
""" """
Creates a new Cell. Creates a new Cell.
""" """
self.invokeFactory(type_name='Accounting Rule Cell', id=id) self.invokeFactory(type_name=portal_type, id=id)
new_cell = self.get(id) new_cell = self.get(id)
return new_cell return new_cell
......
...@@ -61,9 +61,9 @@ class ProductionReportLine(DeliveryLine): ...@@ -61,9 +61,9 @@ class ProductionReportLine(DeliveryLine):
__implements__ = ( ) __implements__ = ( )
security.declareProtected( Permissions.ModifyPortalContent, 'newCellContent') security.declareProtected( Permissions.ModifyPortalContent, 'newCellContent')
def newCellContent(self, id,**kw): def newCellContent(self, id, portal_type='Production Report Cell', **kw):
""" """
This method can be overriden This method can be overriden
""" """
self.invokeFactory(type_name="Production Report Cell",id=id) self.invokeFactory(type_name=portal_type, id=id)
return self.get(id) return self.get(id)
...@@ -68,9 +68,9 @@ class VariatedProperty(XMLObject, XMLMatrix): ...@@ -68,9 +68,9 @@ class VariatedProperty(XMLObject, XMLMatrix):
__implements__ = ( Interface.Variated, ) __implements__ = ( Interface.Variated, )
security.declareProtected( Permissions.ModifyPortalContent, 'newCellContent' ) security.declareProtected( Permissions.ModifyPortalContent, 'newCellContent' )
def newCellContent(self, id, **kw): def newCellContent(self, id, portal_type='Set Mapped Value', **kw):
""" """
This method can be overriden This method can be overriden
""" """
self.invokeFactory(type_name="Set Mapped Value", id=id) self.invokeFactory(type_name=portal_type, id=id)
return self.get(id) return self.get(id)
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