Commit 4ab5cb28 authored by Jérome Perrin's avatar Jérome Perrin

use newContent and propagate **kw

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@31038 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 4b1f23ec
No related merge requests found
......@@ -442,11 +442,9 @@ class AssortedResource(TransformedResource):
security.declareProtected( Permissions.ModifyPortalContent, 'newCellContent' )
def newCellContent(self, id, portal_type='Set Mapped Value', **kw):
"""Overriden to specify default portal type
"""
This method can be overriden
"""
self.invokeFactory(type_name=portal_type, id=id)
return self.get(id)
return self.newContent(id=id, portal_type=portal_type, **kw)
security.declarePrivate('_checkConsistency')
def _checkConsistency(self, fixit=0):
......
......@@ -69,11 +69,9 @@ class ContainerLine(DeliveryLine):
# Cell Related
security.declareProtected( Permissions.ModifyPortalContent, 'newCellContent' )
def newCellContent(self, id, portal_type='Container Cell', **kw):
"""Overriden to specify default portal type
"""
This method can be overriden
"""
self.invokeFactory(type_name=portal_type, id=id)
return self.get(id)
return self.newContent(id=id, portal_type=portal_type, **kw)
security.declareProtected(Permissions.AccessContentsInformation, 'isAccountable')
def isAccountable(self):
......
......@@ -70,11 +70,9 @@ class InvoiceLine(DeliveryLine):
security.declareProtected( Permissions.ModifyPortalContent,
'newCellContent' )
def newCellContent(self, id, portal_type='Invoice Cell', **kw):
"""Overriden to specify default portal type
"""
This method can be overriden
"""
self.invokeFactory(type_name=portal_type, id=id)
return self.get(id)
return self.newContent(id=id, portal_type=portal_type, **kw)
security.declareProtected( Permissions.AccessContentsInformation,
'isAccountable' )
......
......@@ -323,12 +323,9 @@ class InvoiceTransactionRule(Rule, PredicateMatrix):
security.declareProtected( Permissions.ModifyPortalContent,
'newCellContent' )
def newCellContent(self, id, portal_type='Accounting Rule Cell', **kw):
"""Overriden to specify default portal type
"""
Creates a new Cell.
"""
self.invokeFactory(type_name=portal_type, id=id)
new_cell = self.get(id)
return new_cell
return self.newContent(id=id, portal_type=portal_type, **kw)
security.declareProtected(Permissions.ModifyPortalContent, 'solve')
def solve(self, applied_rule, solution_list):
......
......@@ -61,12 +61,10 @@ class PaySheetLine(InvoiceLine):
# Cell Related
security.declareProtected( Permissions.ModifyPortalContent, 'newCellContent' )
def newCellContent(self, id,**kw):
def newCellContent(self, id, portal_type='Pay Sheet Cell', **kw):
"""Overriden to specify default portal type
"""
This method can be overriden
"""
self.invokeFactory(type_name="Pay Sheet Cell",id=id)
return self.get(id)
return self.newContent(id=id, portal_type=portal_type, **kw)
security.declareProtected(Permissions.AccessContentsInformation,
'isAccountable')
......
......@@ -67,9 +67,6 @@ class PaySheetModelLine(TradeModelLine):
security.declareProtected(Permissions.ModifyPortalContent,
'newCellContent' )
def newCellContent(self, id, portal_type='Pay Sheet Model Cell', **kw):
"""Overriden to specify default portal type
"""
Used to be able to create Pay Sheet Model Cell. (portal_type of cells is
hardcoded in inheritated classes, so we have to overload this method)
"""
self.invokeFactory(type_name=portal_type,id=id)
return self.get(id)
return self.newContent(id=id, portal_type=portal_type, **kw)
......@@ -59,8 +59,6 @@ class ProductionReportLine(DeliveryLine):
security.declareProtected( Permissions.ModifyPortalContent, 'newCellContent')
def newCellContent(self, id, portal_type='Production Report Cell', **kw):
"""Overriden to specify default portal type
"""
This method can be overriden
"""
self.invokeFactory(type_name=portal_type, id=id)
return self.get(id)
return self.newContent(id=id, portal_type=portal_type, **kw)
......@@ -68,8 +68,6 @@ class VariatedProperty(XMLObject, XMLMatrix):
security.declareProtected( Permissions.ModifyPortalContent, 'newCellContent' )
def newCellContent(self, id, portal_type='Set Mapped Value', **kw):
"""Overriden to specify default portal type
"""
This method can be overriden
"""
self.invokeFactory(type_name=portal_type, id=id)
return self.get(id)
return self.newContent(id=id, portal_type=portal_type, **kw)
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