Commit f3a76b4e authored by Sebastien Robin's avatar Sebastien Robin

added method getPrice on item

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@9612 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 499b61dd
...@@ -89,3 +89,18 @@ class Item(XMLObject, Amount, ImmobilisableItem): ...@@ -89,3 +89,18 @@ class Item(XMLObject, Amount, ImmobilisableItem):
""" """
return XMLObject.generateNewId(self, id_group=id_group, default=default, method=method) return XMLObject.generateNewId(self, id_group=id_group, default=default, method=method)
def getPrice(self,**kw):
"""
Get the Price in the context.
If price is not stored locally, lookup a price
"""
local_price = self._baseGetPrice()
if local_price is None:
# We must find a price for this movement
resource = self.getResourceValue()
if resource is not None:
local_price = resource.getPrice(self.asContext( context=context, **kw))
return local_price
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