Commit f15f6d52 authored by Jérome Perrin's avatar Jérome Perrin

support default= in getTotalQuantity


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@21189 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 48358df5
......@@ -301,11 +301,11 @@ class Movement(XMLObject, Amount):
security.declareProtected( Permissions.AccessContentsInformation,
'getTotalQuantity')
def getTotalQuantity(self):
def getTotalQuantity(self, default=0.0):
"""
Returns the quantity if no cell or the total quantity if cells
"""
return self.getQuantity()
return self.getQuantity(default=default)
# Industrial price API
security.declareProtected( Permissions.AccessContentsInformation,
......
......@@ -92,8 +92,9 @@ class OrderCell(DeliveryCell):
security.declareProtected(Permissions.AccessContentsInformation,
'getTotalQuantity')
def getTotalQuantity(self, *args, **kw):
def getTotalQuantity(self, default=0.0, *args, **kw):
"only return a value if self is a movement"
if not self.isMovement(): return 0.0
return DeliveryCell.getTotalQuantity(self, *args, **kw)
if not self.isMovement():
return default
return DeliveryCell.getTotalQuantity(self, default=default, *args, **kw)
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