Commit ad94a72d authored by Julien Muchembled's avatar Julien Muchembled

Replace slow contentValues in price calculation

parent 16d2fe28
......@@ -212,8 +212,13 @@ class DeliveryLine(Movement, XMLMatrix, ImmobilisationMovement):
"""
returns true is the object contains no submovement (line or cell)
"""
portal_type = self.getPortalMovementTypeList()
return len(self.contentValues(filter={'portal_type': portal_type})) == 0
object_list = self.objectValues()
if object_list:
portal_type = self.getPortalObject().getPortalMovementTypeList()
for ob in object_list:
if ob.getPortalType() in portal_type:
return False
return True
security.declareProtected(Permissions.AccessContentsInformation, 'getMovedItemUidList')
def getMovedItemUidList(self):
......
......@@ -95,7 +95,7 @@ def _findPredicateList(container_list, portal_type):
mask_set = set()
for container in container_list:
mask_list = []
for ob in container.contentValues(portal_type=portal_type):
for ob in container.objectValues(portal_type=portal_type):
if isinstance(ob, Predicate):
# reference is used to hide lines on farther containers
reference = ob.getProperty('reference')
......
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