Ignore:
Timestamp:
Nov 28, 2010, 12:32:07 PM (14 years ago)
Author:
gav
Message:

Improvements to InventoryItem views.

File:
1 edited

Legend:

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

    r720 r727  
    7070        result.showTab = [:]
    7171        switch (params.showTab) {
    72             case "showDetailTab":
    73                 result.showTab.detail =  new String("true")
    74                 break
    7572            case "showMovementTab":
    7673                result.showTab.movement =  new String("true")
     
    167164
    168165            result.inventoryItemInstance.properties = params
     166            result.inventoryItemInstance.setAlternateSuppliersFromCheckBoxList(params.alternateSuppliers)
     167            result.inventoryItemInstance.setSpareForFromCheckBoxList(params.spareFor)
     168
     169            // Fetch to prevent lazy initialization error.
     170            result.inventoryItemInstance.unitOfMeasure
    169171
    170172            if(result.inventoryItemInstance.hasErrors() || !result.inventoryItemInstance.save())
     
    204206
    205207            result.inventoryItemInstance = new InventoryItem(params)
     208            result.inventoryItemInstance.setAlternateSuppliersFromCheckBoxList(params.alternateSuppliers)
     209            result.inventoryItemInstance.setSpareForFromCheckBoxList(params.spareFor)
    206210
    207211            if(result.inventoryItemInstance.hasErrors() || !result.inventoryItemInstance.save())
Note: See TracChangeset for help on using the changeset viewer.