Commit 9f329a70 authored by Julien Muchembled's avatar Julien Muchembled

Fix workflow history explosion with possibly useless reindex when building in existing delivery

Reindexing a delivery is always recursive so in scenario where lines are added
by many different builders and the values in property_dict are always the same,
the useless reindexing was slower and slower. In the worst case, each builder
adding 1 line, the number of reindexing activities increased quadratically.

See also commit c020b93b.
parent b7efa170
...@@ -484,7 +484,7 @@ class BuilderMixin(XMLObject, Amount, Predicate): ...@@ -484,7 +484,7 @@ class BuilderMixin(XMLObject, Amount, Predicate):
self._setUpdated(delivery, 'delivery') self._setUpdated(delivery, 'delivery')
if property_dict: if property_dict:
property_dict.setdefault('edit_order', ('stop_date', 'start_date')) property_dict.setdefault('edit_order', ('stop_date', 'start_date'))
delivery.edit(**property_dict) delivery._edit(reindex_object=1, **property_dict)
# Then, create delivery line # Then, create delivery line
for grouped_node in movement_group_node.getGroupList(): for grouped_node in movement_group_node.getGroupList():
......
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