Ignore:
Timestamp:
Sep 6, 2010, 4:07:45 AM (14 years ago)
Author:
gav
Message:

Add inventory reorder search, part 2.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/grails-app/controllers/InventoryItemDetailedController.groovy

    r646 r647  
    576576        def suppliers = Supplier.findAllByIsActive(true).sort { p1, p2 -> p1.name.compareToIgnoreCase(p2.name) }
    577577        def inventoryGroups = InventoryGroup.findAllByIsActive(true)
    578         if(!params.selectedGroups)
    579             params.selectedGroups = inventoryGroups.collect{it.id}
     578
     579        if(params.selectedGroups) {
     580            if(params.selectedGroups instanceof String)
     581                params.selectedGroups = [params.selectedGroups.toLong()]
     582            else
     583                params.selectedGroups = params.selectedGroups.collect { it.toLong() }
     584        }
    580585        else
    581             params.selectedGroups = params.selectedGroups.collect { it.toLong() }
     586                params.selectedGroups = []
    582587
    583588        // Restore search unless a new search is being requested.
Note: See TracChangeset for help on using the changeset viewer.