Commit a5d2e603 authored by Jean-Paul Smets's avatar Jean-Paul Smets

check is resource is defined in getPrice


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@4166 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 394d8d46
...@@ -292,7 +292,6 @@ class Amount(Base, Variated): ...@@ -292,7 +292,6 @@ class Amount(Base, Variated):
else: else:
return result return result
security.declareProtected(Permissions.AccessContentsInformation, 'getResourceDefaultQuantityUnit') security.declareProtected(Permissions.AccessContentsInformation, 'getResourceDefaultQuantityUnit')
def getResourceDefaultQuantityUnit(self): def getResourceDefaultQuantityUnit(self):
""" """
...@@ -308,12 +307,15 @@ class Amount(Base, Variated): ...@@ -308,12 +307,15 @@ class Amount(Base, Variated):
security.declareProtected(Permissions.AccessContentsInformation, 'getResourcePrice') security.declareProtected(Permissions.AccessContentsInformation, 'getResourcePrice')
def getResourcePrice(self): def getResourcePrice(self):
""" """
Return default quantity unit of the resource Return price of the resource in the current context
The price is expressed in the standard unit of the resource (?)
""" """
resource = self.getResourceValue() resource = self.getResourceValue()
unit_base_price = resource.getPrice(context=self) if resource is not None:
return unit_base_price return resource.getPrice(context=self)
return None
security.declareProtected(Permissions.AccessContentsInformation, 'getDuration') security.declareProtected(Permissions.AccessContentsInformation, 'getDuration')
def getDuration(self): def getDuration(self):
""" """
...@@ -330,10 +332,17 @@ class Amount(Base, Variated): ...@@ -330,10 +332,17 @@ class Amount(Base, Variated):
duration = None duration = None
return duration return duration
def getPrice(self):
pass
security.declareProtected(Permissions.AccessContentsInformation, 'getTotalBasePrice') security.declareProtected(Permissions.AccessContentsInformation, 'getTotalBasePrice')
def getTotalPrice(self): def getTotalPrice(self):
""" """
Return duration in minute Return total price for the number of items
Price is defined on
""" """
result = None result = None
efficiency = self.getEfficiency() efficiency = self.getEfficiency()
...@@ -573,6 +582,23 @@ class Amount(Base, Variated): ...@@ -573,6 +582,23 @@ class Amount(Base, Variated):
""" """
return None return None
# # SKU vs. CU
# security.declareProtected(Permissions.AccessContentsInformation, 'getStandardInventoriatedQuantity')
# def getStandardInventoriatedQuantity(self):
# """
# The inventoriated quantity converted in a default unit
#
# For assortments, returns the inventoriated quantity in terms of number of items
# in the assortemnt.
#
# For accounting, returns the quantity converted in a default unit
# """
# resource = self.getResourceValue()
# result = self.getInventoriatedQuantity()
# if resource is not None:
# result = resource.standardiseQuantity(result)
# return result
# Profit and Loss # Profit and Loss
security.declareProtected(Permissions.ModifyPortalContent, 'getLostQuantity') security.declareProtected(Permissions.ModifyPortalContent, 'getLostQuantity')
def getLostQuantity(self): def getLostQuantity(self):
......
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