Search in sources :

Example 1 with NotificationItem

use of com.axelor.apps.account.db.NotificationItem in project axelor-open-suite by axelor.

the class NotificationController method displayMoveLines.

public void displayMoveLines(ActionRequest request, ActionResponse response) {
    try {
        Notification notification = request.getContext().asType(Notification.class);
        List<Long> moveLineIdList = new ArrayList<Long>();
        for (NotificationItem notificationItem : notification.getNotificationItemList()) {
            for (MoveLine moveLine : notificationItem.getMove().getMoveLineList()) {
                moveLineIdList.add(moveLine.getId());
            }
        }
        response.setView(ActionView.define("MoveLines").model(MoveLine.class.getName()).add("grid", "move-line-grid").add("form", "move-line-form").param("search-filters", "move-line-filters").domain("self.id in (" + Joiner.on(",").join(moveLineIdList) + ")").map());
    } catch (Exception e) {
        TraceBackService.trace(response, e, ResponseMessageType.ERROR);
    }
}
Also used : NotificationItem(com.axelor.apps.account.db.NotificationItem) ArrayList(java.util.ArrayList) MoveLine(com.axelor.apps.account.db.MoveLine) Notification(com.axelor.apps.account.db.Notification)

Aggregations

MoveLine (com.axelor.apps.account.db.MoveLine)1 Notification (com.axelor.apps.account.db.Notification)1 NotificationItem (com.axelor.apps.account.db.NotificationItem)1 ArrayList (java.util.ArrayList)1