Commit 21534e9d authored by Julien Muchembled's avatar Julien Muchembled

Speed up getMovementList a lot by using objectValues instead of contentValues.

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@26218 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 6ab98af3
...@@ -208,13 +208,12 @@ class Delivery(XMLObject, ImmobilisationDelivery): ...@@ -208,13 +208,12 @@ class Delivery(XMLObject, ImmobilisationDelivery):
movement_list = [] movement_list = []
add_movement = movement_list.append add_movement = movement_list.append
extend_movement = movement_list.extend extend_movement = movement_list.extend
sub_object_list = self.contentValues(filter={'portal_type': portal_type}) sub_object_list = self.objectValues(portal_type=portal_type)
extend_sub_object = sub_object_list.extend extend_sub_object = sub_object_list.extend
append_sub_object = sub_object_list.append append_sub_object = sub_object_list.append
while sub_object_list: while sub_object_list:
sub_object = sub_object_list.pop() sub_object = sub_object_list.pop()
content_list = sub_object.contentValues( content_list = sub_object.objectValues(portal_type=portal_type)
filter={'portal_type': portal_type})
if sub_object.hasCellContent(): if sub_object.hasCellContent():
cell_list = sub_object.getCellValueList() cell_list = sub_object.getCellValueList()
if len(cell_list) != len(content_list): if len(cell_list) != len(content_list):
......
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