• Julien Muchembled's avatar
    Fix useless expand after delivery building · faee5904
    Julien Muchembled authored
    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>
    faee5904
revision 4 Bytes