• Jérome Perrin's avatar
    officejs_support_request_ui: Another approach for worklists · 29795b08
    Jérome Perrin authored
    This reapplies parts of 9a84ef83 , but a
    different server side approach:
     * use portal_workflow API to count worklists
     * introspect workflow to build queries
     * use translated state in the query, trying to be a bit more user
       friendly. We could do for portal_type as well.
    
    This workarounds #20180907-24A654C a problem with queries generated by
    gadget worklist does not seem to support complex queries with multiple
    values ( local_roles: ['Assignor', 'Assignee'] ). This code generates
    queries:
    
    ```
    ( ( local_roles:  "Assignee" OR local_roles:  "Assignor" ) AND portal_type:  "Support Request" AND translated_simulation_state_title:  "Opened" )
    ```
    
    where the previous version generated queries like:
    
    ```
    ( portal_type:  "Support Request" AND simulation_state:  "validated" AND local_roles: (  "Assignee" OR  "Assignor" ) )
    ```
    
    which did not match anything. Maybe because local_roles is handled
    differently in catalog
    29795b08
ERP5Site_getTicketWorkflowWorklistInfoDict.py 1.45 KB