Commit 9a98a644 authored by Alexandre Boeglin's avatar Alexandre Boeglin

Updated getTotalPrice and getTotalQuantity to use buildSQLQuery.


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@2712 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 55985805
...@@ -557,10 +557,11 @@ class Delivery(XMLObject): ...@@ -557,10 +557,11 @@ class Delivery(XMLObject):
""" """
Returns the total price for this order Returns the total price for this order
""" """
kw['delivery_uid'] = self.getUid()
kw.update(self.portal_catalog.buildSQLQuery(**kw)) kw.update(self.portal_catalog.buildSQLQuery(**kw))
if src__: if src__:
return self.Delivery_zGetTotal(src__=1, uid=self.getUid(), **kw) return self.Delivery_zGetTotal(src__=1, **kw)
aggregate = self.Delivery_zGetTotal(uid=self.getUid(), **kw)[0] aggregate = self.Delivery_zGetTotal(**kw)[0]
return aggregate.total_price return aggregate.total_price
security.declareProtected(Permissions.AccessContentsInformation, 'getTotalQuantity') security.declareProtected(Permissions.AccessContentsInformation, 'getTotalQuantity')
...@@ -568,10 +569,11 @@ class Delivery(XMLObject): ...@@ -568,10 +569,11 @@ class Delivery(XMLObject):
""" """
Returns the quantity if no cell or the total quantity if cells Returns the quantity if no cell or the total quantity if cells
""" """
kw['delivery_uid'] = self.getUid()
kw.update(self.portal_catalog.buildSQLQuery(**kw)) kw.update(self.portal_catalog.buildSQLQuery(**kw))
if src__: if src__:
return self.Delivery_zGetTotal(src__=1, uid=self.getUid(), **kw) return self.Delivery_zGetTotal(src__=1, **kw)
aggregate = self.Delivery_zGetTotal(uid=self.getUid(), **kw)[0] aggregate = self.Delivery_zGetTotal(**kw)[0]
return aggregate.total_quantity return aggregate.total_quantity
security.declareProtected(Permissions.AccessContentsInformation, 'getDeliveryUid') security.declareProtected(Permissions.AccessContentsInformation, 'getDeliveryUid')
......
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