• Julien Muchembled's avatar
    Fix/optimize Base.getModificationDate() and make it return ZODB date as fallback · cb634656
    Julien Muchembled authored
    Previous implementation only considered workflows that are chained to the
    portal type:
    - this is slower
    - modification_date of old documents may change or disappear, preventing their
      reindexation
    - edit_workflow was always considered, regardless it is chained or not
    
    This commit makes getModificationDate more consistent: it simply iterates over
    all workflow histories stored on the object.
    
    When there is no workflow history, ZODB date is returned, which makes
    getModificationDate useful for objects without any workflow chained, like
    simulation movements.
    
    Another optimization is that last history entry is accessed without loading
    the whole history.
    cb634656
Base.py 151 KB