Skip to content
  • Rafael Monnerat's avatar
    ERP5Security: Unify getValidAssignmentList implementation · 634e4bcb
    Rafael Monnerat authored
      Move all different implementation of 'getValidAssignmentList' into
      Utils.py
    
        - getValidAssignmentList: Used everywhere, no cache, accepts
        start_date only setting.
    
        - getCachedValidAssignmentList: Same as above, however cached over
          the transaction per user (parameter)
    
        - hasValidAssignment: Return True as soon it finds the first
          valid one, with no cache.
    
      Allow import *ValidAssignmentList directly on Restricted Python so we
      don't need to write External Methods to re-use the implementation.
    
      Related code was updated accross the business templates, the solo
      difference in implementation is that StandardSecurity use
      transactional cache version rather then no cache. This prevents code
      re-calculate the assignment list more then once accross the
      transaction. Due this cache was updated acordinally.
    
      Other locations were kept using uncached version for compatibility
      since it has low impact or it is not widely used code.
    
    x
    634e4bcb