Commit faee5904 authored by Julien Muchembled's avatar Julien Muchembled

Fix useless expand after delivery building

This fixes a performance regression introduced in
commit 0a8fbb36
("Simulation: index 'delivery' categories in ZODB")

Built delivery lines are modified by newContent(), before
SimulatedDeliveryBuilder._setDeliveryMovementProperties() has a chance to set
the delivery link on the related simulation movement.
So isGeneratedBySimulation() always returned False.

One solution was to revert all changes in
  product/ERP5/Document/Movement.py
  product/ERP5/Document/SimulatedDeliveryBuilder.py
from the aforementioned commit, but it's much simpler to move the interaction
at the end of the transaction, even if in some rare cases, 2 '_updateSimulation'
activities are created, causing a slight overhead on activity tool.
Signed-off-by: Kazuhiko Shiozaki's avatarKazuhiko Shiozaki <kazuhiko@nexedi.com>
parent 331fed02
......@@ -27,15 +27,15 @@
<item>
<key> <string>after_script_name</string> </key>
<value>
<list>
<string>DeliveryMovement_updateSimulation</string>
</list>
<tuple/>
</value>
</item>
<item>
<key> <string>before_commit_script_name</string> </key>
<value>
<tuple/>
<list>
<string>DeliveryMovement_updateSimulation</string>
</list>
</value>
</item>
<item>
......
1034
\ No newline at end of file
1035
\ No newline at end of file
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