Ignore:
Timestamp:
Nov 25, 2010, 9:08:43 AM (14 years ago)
Author:
gav
Message:

Domain change: as per ticket #96 - Remove unused fields from InventoryItem?.
Removed InventoryItem?.alternateItems.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/grails-app/services/InventoryItemService.groovy

    r636 r720  
    1313    def sessionFactory
    1414    def propertyInstanceMap = org.codehaus.groovy.grails.plugins.DomainClassGrailsPlugin.PROPERTY_INSTANCE_MAP
    15 
    16     /**
    17     * Prepare a sorted list of possible alternateItems.
    18     */
    19     def getPossibleAlternateItems(inventoryItemInstance) {
    20         def criteria = inventoryItemInstance.createCriteria()
    21         def possibleAlternateItems = criteria {
    22             and {
    23                 eq('isActive', true)
    24                 notEqual('id', inventoryItemInstance.id)
    25             }
    26         }.sort { p1, p2 -> p1.name.compareToIgnoreCase(p2.name) }
    27     }
    2815
    2916    /**
     
    129116                return fail(code:"inventoryMovement.still.associated")
    130117
    131             result.inventoryItemInstance.removeReverseAlternateItems()
    132 
    133118            try {
    134119                result.inventoryItemInstance.delete(flush:true)
     
    181166            }
    182167
    183             def previousAlternateItems = new ArrayList(result.inventoryItemInstance.alternateItems)
    184 
    185168            result.inventoryItemInstance.properties = params
    186169
    187170            if(result.inventoryItemInstance.hasErrors() || !result.inventoryItemInstance.save())
    188171                return fail(code:"default.update.failure")
    189 
    190             result.inventoryItemInstance.removeReverseAlternateItems(previousAlternateItems)
    191             result.inventoryItemInstance.addReverseAlternateItems()
    192172
    193173            // Success.
Note: See TracChangeset for help on using the changeset viewer.