Commit 202d62ff authored by Guillaume Michon's avatar Guillaume Michon

Sorry, previous change was a mistake


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@4647 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent d4028a66
......@@ -71,8 +71,11 @@ class InventoryCell(DeliveryCell):
DeliveryCell._edit(self, REQUEST=REQUEST, force_update = force_update, **kw)
# Calculate inventory
item_list = self.getAggregateValueList()
inventory = len(item_list)
if inventory != 0:
if item_list not in [None,[]]:
inventory = 0
for item in item_list:
if item.getQuantity() not in [None, '']:
inventory += item.getQuantity()
self.setInventory(inventory)
......
......@@ -71,9 +71,11 @@ class InventoryLine(DeliveryLine):
DeliveryLine._edit(self, REQUEST=REQUEST, force_update = force_update, **kw)
# Calculate inventory
item_list = self.getAggregateValueList()
if item_list is not None:
inventory = len(item_list)
if inventory != 0:
if item_list not in [None,[]]:
inventory = 0
for item in item_list:
if item.getQuantity() not in [None, '']:
inventory += item.getQuantity()
self.setInventory(inventory)
......
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