Ignore:
Timestamp:
Nov 19, 2009, 9:16:21 PM (15 years ago)
Author:
gav
Message:

Improve entry creation so that entryType is passed in with the associated submitButton.
Refactor InventoryMovementService and prevent create/delete of invenotryMovements on complete task.

Location:
trunk/grails-app/controllers
Files:
2 edited

Legend:

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

    r186 r191  
    9696            def entryInstance = new Entry()
    9797            entryInstance.task = taskInstance
     98            entryInstance.entryType = EntryType.get(params.entryType.id)
    9899            return ['entryInstance':entryInstance]
    99100        }
  • trunk/grails-app/controllers/InventoryMovementDetailedController.groovy

    r177 r191  
    3434        else {
    3535            if(result.inventoryMovementInstance) {
    36                 render(view:'show',model:[inventoryMovementInstance:result.inventoryMovementInstance])
     36                // For some reason we have to call refresh() here to get a hibernate session
     37                // and avoid a lazy initialisation error.
     38                render(view:'show',model:[inventoryMovementInstance:result.inventoryMovementInstance.refresh()])
    3739            }
    3840            else {
    3941                flash.message = "Could not delete inventory movement."
    40                 redirect(controller:"taskDetailed", action:"search", id:result.taskId)
     42                redirect(controller:"taskDetailed", action:"search")
    4143            }
    4244        }
Note: See TracChangeset for help on using the changeset viewer.