Commit b5f467e6 authored by Fabien Morin's avatar Fabien Morin

- add security declaration

- typo


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@27468 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent ca85c850
No related merge requests found
......@@ -64,5 +64,7 @@ class PaySheetCell(InvoiceCell):
, PropertySheet.MappedValue
)
security.declareProtected(Permissions.AccessContentsInformation,
'isAccountable')
def isAccountable(self):
return 1
......@@ -74,7 +74,7 @@ class PaySheetLine(InvoiceLine):
self.invokeFactory(type_name="Pay Sheet Cell",id=id)
return self.get(id)
security.declareProtected(Permissions.AccessContentsInformationi,
security.declareProtected(Permissions.AccessContentsInformation,
'isAccountable')
def isAccountable(self):
return 1
......@@ -68,9 +68,9 @@ class PaySheetModelLine(TradeModelLine):
, PropertySheet.Predicate
, PropertySheet.Reference
)
security.declareProtected( Permissions.ModifyPortalContent,
'newCellContent' )
security.declareProtected(Permissions.ModifyPortalContent,
'newCellContent' )
def newCellContent(self, id, portal_type='Pay Sheet Model Cell', **kw):
"""
Used to be able to create Pay Sheet Model Cell. (portal_type of cells is
......
......@@ -68,7 +68,7 @@ class PaySheetTransaction(Invoice):
__implements__ = ( )
security.declareProtected(Permissions.AccessContentsInformation,
'getRatioQuantityFromReference')
'getRatioQuantityFromReference')
def getRatioQuantityFromReference(self, ratio_reference=None):
"""
return the ratio value correponding to the ratio_reference,
......@@ -91,7 +91,7 @@ class PaySheetTransaction(Invoice):
return None
security.declareProtected(Permissions.AccessContentsInformation,
'getRatioQuantityList')
'getRatioQuantityList')
def getRatioQuantityList(self, ratio_reference_list):
"""
Return a list of reference_ratio_list correponding values.
......@@ -104,7 +104,7 @@ class PaySheetTransaction(Invoice):
for reference in ratio_reference_list]
security.declareProtected(Permissions.AccessContentsInformation,
'getAnnotationLineFromReference')
'getAnnotationLineFromReference')
def getAnnotationLineFromReference(self, reference=None):
"""Return the annotation line corresponding to the reference.
Returns None if reference not found
......@@ -122,10 +122,10 @@ class PaySheetTransaction(Invoice):
return None
security.declareProtected(Permissions.AccessContentsInformation,
'getAnnotationLineListList')
'getAnnotationLineListList')
def getAnnotationLineListList(self, reference_list):
"""Return a list of annotation lines corresponding to the reference_list
reference_list is a list of references to the Annotation Line we want
reference_list is a list of references to the Annotation Line we want
to get.
"""
if not isinstance(reference_list, (list, tuple)):
......@@ -133,6 +133,8 @@ class PaySheetTransaction(Invoice):
return [self.getAnnotationLineFromReference(reference) \
for reference in reference_list]
security.declareProtected(Permissions.AccessContentsInformation,
'getInheritedObjectValueList')
def getInheritedObjectValueList(self, portal_type_list, property_list=()):
'''Return a list of all subobjects of the herited model (incuding the
dependencies).
......@@ -152,6 +154,8 @@ class PaySheetTransaction(Invoice):
sub_object_list.extend([model._getOb(x) for x in id_list])
return sub_object_list
security.declareProtected(Permissions.ModifyPortalContent,
'applyTransformation')
def applyTransformation(self):
'''use a delivery builder to create all the paysheet lines using
movements return by updateAggregatedAmountList
......
......@@ -72,6 +72,8 @@ class TradeCondition(Path, Transformation):
, PropertySheet.Order
)
security.declareProtected(Permissions.ModifyPortalContent,
'updateAggregatedAmountList')
def updateAggregatedAmountList(self, context, **kw):
'''
updates exisiting movement and returns new if any
......@@ -142,6 +144,8 @@ class TradeCondition(Path, Transformation):
visited_trade_condition_list=visited_trade_condition_list))
return specialise_value_list
security.declareProtected(Permissions.AccessContentsInformation,
'getTradeModelLineComposedList')
def getTradeModelLineComposedList(self, context=None, portal_type_list=None):
"""
Returns list of Trade Model Lines using composition
......@@ -178,6 +182,8 @@ class TradeCondition(Path, Transformation):
cmp=lambda x,y: set(x.getBaseContributionList()).
intersection(set(y.getBaseApplicationList())) and -1 or 1)
security.declareProtected(Permissions.AccessContentsInformation,
'getAggregatedAmountList')
def getAggregatedAmountList(self, context, movement_list=None, **kw):
result = AggregatedAmountList()
......
......@@ -63,12 +63,16 @@ class TradeModelLine(Predicate, XMLMatrix, Amount):
, PropertySheet.Predicate
)
security.declareProtected(Permissions.AccessContentsInformation,
'getPrice')
def getPrice(self):
return self._baseGetPrice()
def updateAggregatedAmountList(self, context, **kw):
raise NotImplementedError('TODO')
security.declareProtected(Permissions.AccessContentsInformation,
'getAggregatedAmountList')
def getAggregatedAmountList(self, context, movement_list = None,
current_aggregated_amount_list = None, base_id='movement', **kw):
from Products.ERP5Type.Document import newTempSimulationMovement
......
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