Commit d6b444d0 authored by Fabien Morin's avatar Fabien Morin

move method from PaySheetModel to PaySheetTransaction because there are used

only with it


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@17674 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent ed12d940
...@@ -28,7 +28,6 @@ ...@@ -28,7 +28,6 @@
from AccessControl import ClassSecurityInfo from AccessControl import ClassSecurityInfo
from Products.ERP5Type import Permissions, PropertySheet, Constraint, Interface from Products.ERP5Type import Permissions, PropertySheet, Constraint, Interface
from Products.ERP5.Document.Invoice import Invoice from Products.ERP5.Document.Invoice import Invoice
class PaySheetTransaction(Invoice): class PaySheetTransaction(Invoice):
...@@ -68,6 +67,36 @@ class PaySheetTransaction(Invoice): ...@@ -68,6 +67,36 @@ class PaySheetTransaction(Invoice):
__implements__ = ( ) __implements__ = ( )
security.declareProtected(Permissions.AccessContentsInformation,
'getRatioQuantityFromReference')
def getRatioQuantityFromReference(self, ratio_reference=None):
"""
return the ratio value correponding to the ratio_reference,
or description if ratio value is empty,
None if ratio_reference not found
"""
object_ratio_list = self.contentValues(portal_type=\
'Pay Sheet Model Ratio Line')
for object in object_ratio_list:
if object.getReference() == ratio_reference:
return object.getQuantity()
return None
security.declareProtected(Permissions.AccessContentsInformation,
'getRatioQuantityList')
def getRatioQuantityList(self, ratio_reference_list):
"""
Return a list of reference_ratio_list correponding values.
reference_ratio_list is a list of references to the ratio lines
we want to get.
"""
if not isinstance(ratio_reference_list, list):
return [self.getRatioQuantityFromReference(ratio_reference_list)]
return [self.getRatioQuantityFromReference(reference) \
for reference in ratio_reference_list]
security.declareProtected(Permissions.AddPortalContent, security.declareProtected(Permissions.AddPortalContent,
'createPaySheetLine') 'createPaySheetLine')
def createPaySheetLine(self, cell_list, title='', res='', desc='', **kw): def createPaySheetLine(self, cell_list, title='', res='', desc='', **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