Commit c1aa8963 authored by Sebastien Robin's avatar Sebastien Robin

make sure getQuantity is working even if the value is 0

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@11608 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 668359ac
......@@ -108,12 +108,14 @@ class InventoryLine(DeliveryLine):
if not self.hasCellContent():
# First check if quantity already exists
quantity = self._baseGetQuantity()
if quantity not in (0.0, 0, None):
if quantity not in (0.0,0,None):
return quantity
# Make sure inventory is defined somewhere (here or parent)
if getattr(aq_base(self), 'inventory', None) is None:
return 0.0 # No inventory defined, so no quantity
return self.getInventory()
_marker = []
inventory = getattr(aq_base(self), 'inventory', _marker)
if inventory is not _marker:
return inventory
return quantity
else:
return None
......
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