Commit 89cfd319 authored by Jérome Perrin's avatar Jérome Perrin

remove InventoryListBrain.getQuantity

InventoryListBrain does not need a getQuantity method which returns something
else that the total_quantity on this brain, this is just confusing (and using
movement table)
parent 5a0b9189
...@@ -133,25 +133,6 @@ class InventoryListBrain(ZSQLBrain): ...@@ -133,25 +133,6 @@ class InventoryListBrain(ZSQLBrain):
variation_text=self.variation_text, variation_text=self.variation_text,
resource=self.resource_relative_url, **kw) resource=self.resource_relative_url, **kw)
def getQuantity(self, **kw):
"""
Return the quantity of the current delivery for a resource
"""
total_kw = {
'movement.explanation_uid': self.getExplanationUid(),
'movement.resource_uid': self.resource_uid,
'movement.variation_text': self.variation_text,
}
total_kw.update(self.portal_catalog.buildSQLQuery(**total_kw))
result = self.Delivery_zGetTotal(**total_kw)
inventory = None
if len(result) > 0:
inventory = result[0].inventory
if inventory is None:
return 0.0
else:
return inventory
def getQuantityUnit(self, **kw): def getQuantityUnit(self, **kw):
try: try:
resource = self.portal_categories.unrestrictedTraverse( resource = self.portal_categories.unrestrictedTraverse(
......
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