diff --git a/product/ERP5/Document/Item.py b/product/ERP5/Document/Item.py index 10381279e512175463e2ad8ce79220b1ec805542..5ba1095763b22ffc1c7ccf43bb2e8de295da2ef6 100644 --- a/product/ERP5/Document/Item.py +++ b/product/ERP5/Document/Item.py @@ -89,3 +89,18 @@ class Item(XMLObject, Amount, ImmobilisableItem): """ 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 + +