Search code examples
sap-commerce-cloudbackoffice

Hybris hide orders from display in backoffice with particular statuses


As per requirement, I need to not list in backoffice the Orders with CANCELED and FAILED status for all the employees except Admin, is there any way to modify the backoffice logic in order to not show the orders with particular statuses?


Solution

  • Achieved using SearchRestriction:

    INSERT_UPDATE SearchRestriction; code[unique = true]                                ; name[lang = en]; restrictedType(code); principal(uid)                ; active; generate; query
                               ; order_status_estricted                 ;                ; Order               ; vendoradministratorgroup      ; true  ; true    ; {status} IN ( {{ SELECT {os.pk} FROM {OrderStatus as os} WHERE {os.code} NOT IN ('CANCELED')  }} )